core/math
math
Types
1Float_Class
Float_Class :: enum int {
Normal = 0, // an ordinary nonzero floating point value
Subnormal = 1, // a subnormal floating point value
Zero = 2, // zero
Neg_Zero = 3, // the negative zero
NaN = 4, // Not-A-Number (NaN)
Inf = 5, // positive infinity
Neg_Inf = 6, // negative infinity
}SourceConstants
79DEG_PER_RAD
DEG_PER_RAD :: _ = 360.0/TAUSourceE
E :: 2.71828182845904523536SourceF16_BIAS
F16_BIAS :: 0xfSourceF16_DIG
F16_DIG :: 3SourceF16_EPSILON
F16_EPSILON :: 0.00097656SourceF16_GUARD
F16_GUARD :: 0SourceF16_MANT_DIG
F16_MANT_DIG :: 11SourceF16_MASK
F16_MASK :: 0x1fSourceF16_MAX
F16_MAX :: 65504.0SourceF16_MAX_10_EXP
F16_MAX_10_EXP :: 4SourceF16_MAX_EXP
F16_MAX_EXP :: 15SourceF16_MIN
F16_MIN :: 6.10351562e-5SourceF16_MIN_10_EXP
F16_MIN_10_EXP :: -4SourceF16_MIN_EXP
F16_MIN_EXP :: -14SourceF16_NORMALIZE
F16_NORMALIZE :: 0SourceF16_RADIX
F16_RADIX :: 2SourceF16_ROUNDS
F16_ROUNDS :: 1SourceF16_SHIFT
F16_SHIFT :: 16 - 6SourceF32_BIAS
F32_BIAS :: 0x7fSourceF32_DIG
F32_DIG :: 6SourceF32_EPSILON
F32_EPSILON :: 1.192092896e-07SourceF32_GUARD
F32_GUARD :: 0SourceF32_MANT_DIG
F32_MANT_DIG :: 24SourceF32_MASK
F32_MASK :: 0xffSourceF32_MAX
F32_MAX :: 3.402823466e+38SourceF32_MAX_10_EXP
F32_MAX_10_EXP :: 38SourceF32_MAX_EXP
F32_MAX_EXP :: 128SourceF32_MIN
F32_MIN :: 1.175494351e-38SourceF32_MIN_10_EXP
F32_MIN_10_EXP :: -37SourceF32_MIN_EXP
F32_MIN_EXP :: -125SourceF32_NORMALIZE
F32_NORMALIZE :: 0SourceF32_RADIX
F32_RADIX :: 2SourceF32_ROUNDS
F32_ROUNDS :: 1SourceF32_SHIFT
F32_SHIFT :: 32 - 9SourceF64_BIAS
F64_BIAS :: 0x3ffSourceF64_DIG
F64_DIG :: 15SourceNumber of representable decimal digits.
F64_EPSILON
F64_EPSILON :: 2.2204460492503131e-016SourceSmallest number such that 1.0 + F64_EPSILON != 1.0.
F64_MANT_DIG
F64_MANT_DIG :: 53SourceNumber of bits in the mantissa.
F64_MASK
F64_MASK :: 0x7ffSourceF64_MAX
F64_MAX :: 1.7976931348623158e+308SourceMaximum representable value.
F64_MAX_10_EXP
F64_MAX_10_EXP :: 308SourceMaximum base-10 exponent yielding normalized value.
F64_MAX_EXP
F64_MAX_EXP :: 1024SourceOne greater than the maximum possible base-2 exponent yielding normalized value.
F64_MIN
F64_MIN :: 2.2250738585072014e-308SourceMinimum positive normalized value.
F64_MIN_10_EXP
F64_MIN_10_EXP :: -307SourceMinimum base-10 exponent yielding normalized value.
F64_MIN_EXP
F64_MIN_EXP :: -1021SourceOne greater than the minimum possible base-2 exponent yielding normalized value.
F64_RADIX
F64_RADIX :: 2SourceExponent radix.
F64_ROUNDS
F64_ROUNDS :: 1SourceAddition rounding: near.
F64_SHIFT
F64_SHIFT :: 64 - 12SourceINF_F16
INF_F16 :: f16 = f16(0h7C00)SourceINF_F32
INF_F32 :: f32 = f32(0h7F80_0000)SourceINF_F64
INF_F64 :: f64 = f64(0h7FF0_0000_0000_0000)SourceLN10
LN10 :: 2.30258509299404568401799145468436421SourceLN2
LN2 :: 0.693147180559945309417232121458176568SourceMAX_F16_PRECISION
MAX_F16_PRECISION :: 4SourceMaximum number of meaningful digits after the decimal point for 'f16'
MAX_F32_PRECISION
MAX_F32_PRECISION :: 8SourceMaximum number of meaningful digits after the decimal point for 'f32'
MAX_F64_PRECISION
MAX_F64_PRECISION :: 16SourceMaximum number of meaningful digits after the decimal point for 'f64'
NEG_INF_F16
NEG_INF_F16 :: f16 = f16(0hFC00)SourceNEG_INF_F32
NEG_INF_F32 :: f32 = f32(0hFF80_0000)SourceNEG_INF_F64
NEG_INF_F64 :: f64 = f64(0hFFF0_0000_0000_0000)SourcePI
PI :: 3.14159265358979323846264338327950288SourceQNAN_F16
QNAN_F16 :: f16 = f16(0h7E01)SourceQNAN_F32
QNAN_F32 :: f32 = f32(0hFFC0_0001)SourceQNAN_F64
QNAN_F64 :: f64 = f64(0h7FF8_0000_0000_0001)SourceRAD_PER_DEG
RAD_PER_DEG :: _ = TAU/360.0SourceSNAN_F16
SNAN_F16 :: f16 = f16(0h7C01)SourceSNAN_F32
SNAN_F32 :: f32 = f32(0hFF80_0001)SourceSNAN_F64
SNAN_F64 :: f64 = f64(0h7FF0_0000_0000_0001)SourceSQRT_FIVE
SQRT_FIVE :: 2.23606797749978969640917366873127623SourceSQRT_THREE
SQRT_THREE :: 1.73205080756887729352744634150587236SourceSQRT_TWO
SQRT_TWO :: 1.41421356237309504880168872420969808SourceTAU
TAU :: 6.28318530717958647692528676655900576Sourceabs
abs :: builtin.absSourceclamp
clamp :: builtin.clampSourcee
e :: ESourcemax
max :: builtin.maxSourcemin
min :: builtin.minSourcesplit_decimal
split_decimal :: modfSourceπ
π :: PISourceτ
τ :: TAUSourceProcedures
468_trig_reduce_f64
_trig_reduce_f64 :: proc(x: f64) -> (j: u64, z: f64)Source_trig_reduce_f64 implements Payne-Hanek range reduction by Pi/4 for x > 0. It returns the integer part mod 8 (j) and the fractional part (z) of x / (Pi/4). The implementation is based on: "ARGUMENT REDUCTION FOR HUGE ARGUMENTS: Good to the Last Bit" K. C. Ng et al, March 24, 1992 The simulated multi-precision calculation of x*B uses 64-bit integer arithmetic.
acos_f16
acos_f16 :: proc(x: f16) -> (f16)Sourceacos_f16be
acos_f16be :: proc(x: f16be) -> (f16be)Sourceacos_f16le
acos_f16le :: proc(x: f16le) -> (f16le)Sourceacos_f32
acos_f32 :: proc(x: f32) -> (f32)Sourceacos_f32be
acos_f32be :: proc(x: f32be) -> (f32be)Sourceacos_f32le
acos_f32le :: proc(x: f32le) -> (f32le)Sourceacos_f64
acos_f64 :: proc(x: f64) -> (f64)Sourceacos_f64be
acos_f64be :: proc(x: f64be) -> (f64be)Sourceacos_f64le
acos_f64le :: proc(x: f64le) -> (f64le)Sourceacosh
acosh :: proc(y: T) -> (T)Sourceangle_diff
angle_diff :: proc(a: T, b: T) -> (T)Sourceangle_lerp
angle_lerp :: proc(a: T, b: T, t: T) -> (T)Sourceasin_f16
asin_f16 :: proc(x: f16) -> (f16)Sourceasin_f16be
asin_f16be :: proc(x: f16be) -> (f16be)Sourceasin_f16le
asin_f16le :: proc(x: f16le) -> (f16le)Sourceasin_f32
asin_f32 :: proc(x: f32) -> (f32)Sourceasin_f32be
asin_f32be :: proc(x: f32be) -> (f32be)Sourceasin_f32le
asin_f32le :: proc(x: f32le) -> (f32le)Sourceasin_f64
asin_f64 :: proc(x: f64) -> (f64)Sourceasin_f64be
asin_f64be :: proc(x: f64be) -> (f64be)Sourceasin_f64le
asin_f64le :: proc(x: f64le) -> (f64le)Sourceasinh
asinh :: proc(y: T) -> (T)Sourceatan
atan :: proc(x: T) -> (T)SourceReturn the arc tangent of x, in radians. Defined on the domain of [-∞, ∞] with a range of [-π/2, π/2]
atan2_f16
atan2_f16 :: proc(y: f16, x: f16) -> (f16)Sourceatan2_f16be
atan2_f16be :: proc(y: f16be, x: f16be) -> (f16be)Sourceatan2_f16le
atan2_f16le :: proc(y: f16le, x: f16le) -> (f16le)Sourceatan2_f32
atan2_f32 :: proc(y: f32, x: f32) -> (f32)Sourceatan2_f32be
atan2_f32be :: proc(y: f32be, x: f32be) -> (f32be)Sourceatan2_f32le
atan2_f32le :: proc(y: f32le, x: f32le) -> (f32le)Sourceatan2_f64
atan2_f64 :: proc(y: f64, x: f64) -> (f64)Sourceatan2_f64be
atan2_f64be :: proc(y: f64be, x: f64be) -> (f64be)Sourceatan2_f64le
atan2_f64le :: proc(y: f64le, x: f64le) -> (f64le)Sourceatanh
atanh :: proc(y: T) -> (T)Sourcebias
bias :: proc(t: T, b: T) -> (T)Sourcebinomial
binomial :: proc(n: int, k: int) -> (int)Sourcecbrt_f16
cbrt_f16 :: proc(x: f16) -> (f16)Sourcecbrt_f16be
cbrt_f16be :: proc(x: f16be) -> (f16be)Sourcecbrt_f16le
cbrt_f16le :: proc(x: f16le) -> (f16le)Sourcecbrt_f32
cbrt_f32 :: proc(x: f32) -> (f32)Sourcecbrt_f32be
cbrt_f32be :: proc(x: f32be) -> (f32be)Sourcecbrt_f32le
cbrt_f32le :: proc(x: f32le) -> (f32le)Sourcecbrt_f64
cbrt_f64 :: proc(x: f64) -> (f64)Sourcecbrt returns the cube root of x.
Special cases are:
cbrt(±0) = ±0
cbrt(±Inf) = ±Inf
cbrt(NaN) = NaNcbrt_f64be
cbrt_f64be :: proc(x: f64be) -> (f64be)Sourcecbrt_f64le
cbrt_f64le :: proc(x: f64le) -> (f64le)Sourceceil_f16
ceil_f16 :: proc(x: f16) -> (f16)Sourceceil_f16be
ceil_f16be :: proc(x: f16be) -> (f16be)Sourceceil_f16le
ceil_f16le :: proc(x: f16le) -> (f16le)Sourceceil_f32
ceil_f32 :: proc(x: f32) -> (f32)Sourceceil_f32be
ceil_f32be :: proc(x: f32be) -> (f32be)Sourceceil_f32le
ceil_f32le :: proc(x: f32le) -> (f32le)Sourceceil_f64
ceil_f64 :: proc(x: f64) -> (f64)Sourceceil_f64be
ceil_f64be :: proc(x: f64be) -> (f64be)Sourceceil_f64le
ceil_f64le :: proc(x: f64le) -> (f64le)Sourceclassify_f16
classify_f16 :: proc(x: f16) -> (Float_Class)Sourceclassify_f16be
classify_f16be :: proc(x: f16be) -> (Float_Class)Sourceclassify_f16le
classify_f16le :: proc(x: f16le) -> (Float_Class)Sourceclassify_f32
classify_f32 :: proc(x: f32) -> (Float_Class)Sourceclassify_f32be
classify_f32be :: proc(x: f32be) -> (Float_Class)Sourceclassify_f32le
classify_f32le :: proc(x: f32le) -> (Float_Class)Sourceclassify_f64
classify_f64 :: proc(x: f64) -> (Float_Class)Sourceclassify_f64be
classify_f64be :: proc(x: f64be) -> (Float_Class)Sourceclassify_f64le
classify_f64le :: proc(x: f64le) -> (Float_Class)Sourcecopy_sign_f16
copy_sign_f16 :: proc(x: f16, y: f16) -> (f16)Sourcecopy_sign_f16be
copy_sign_f16be :: proc(x: f16be, y: f16be) -> (f16be)Sourcecopy_sign_f16le
copy_sign_f16le :: proc(x: f16le, y: f16le) -> (f16le)Sourcecopy_sign_f32
copy_sign_f32 :: proc(x: f32, y: f32) -> (f32)Sourcecopy_sign_f32be
copy_sign_f32be :: proc(x: f32be, y: f32be) -> (f32be)Sourcecopy_sign_f32le
copy_sign_f32le :: proc(x: f32le, y: f32le) -> (f32le)Sourcecopy_sign_f64
copy_sign_f64 :: proc(x: f64, y: f64) -> (f64)Sourcecopy_sign_f64be
copy_sign_f64be :: proc(x: f64be, y: f64be) -> (f64be)Sourcecopy_sign_f64le
copy_sign_f64le :: proc(x: f64le, y: f64le) -> (f64le)Sourcecos_f16
cos_f16 :: proc() -> (f16)Sourcecos_f16be
cos_f16be :: proc() -> (f16be)Sourcecos_f16le
cos_f16le :: proc() -> (f16le)Sourcecos_f32
cos_f32 :: proc() -> (f32)Sourcecos_f32be
cos_f32be :: proc() -> (f32be)Sourcecos_f32le
cos_f32le :: proc() -> (f32le)Sourcecos_f64
cos_f64 :: proc() -> (f64)Sourcecos_f64be
cos_f64be :: proc() -> (f64be)Sourcecos_f64le
cos_f64le :: proc() -> (f64le)Sourcecosh
cosh :: proc(x: T) -> (T)Sourcecount_digits_of_base
count_digits_of_base :: proc(value: T, base: int) -> (digits: int)Sourcecumsum
cumsum :: proc(dst: T, src: T) -> (T)Sourcecumsum_inplace
cumsum_inplace :: proc(x: T)Sourcedivmod
divmod :: proc(x: T, y: T) -> (div: T, mod: T)Sourceerf_f16
erf_f16 :: proc(x: f16) -> (f16)Sourceerf_f16be
erf_f16be :: proc(x: f16be) -> (f16be)Sourceerf_f16le
erf_f16le :: proc(x: f16le) -> (f16le)Sourceerf_f32
erf_f32 :: proc(x: f32) -> (f32)Sourceerf_f32be
erf_f32be :: proc(x: f32be) -> (f32be)Sourceerf_f32le
erf_f32le :: proc(x: f32le) -> (f32le)Sourceerf_f64
erf_f64 :: proc(x: f64) -> (f64)Sourceerfc_f16
erfc_f16 :: proc(x: f16) -> (f16)Sourceerfc_f16be
erfc_f16be :: proc(x: f16be) -> (f16be)Sourceerfc_f16le
erfc_f16le :: proc(x: f16le) -> (f16le)Sourceerfc_f32
erfc_f32 :: proc(x: f32) -> (f32)Sourceerfc_f32be
erfc_f32be :: proc(x: f32be) -> (f32be)Sourceerfc_f32le
erfc_f32le :: proc(x: f32le) -> (f32le)Sourceerfc_f64
erfc_f64 :: proc(x: f64) -> (f64)Sourceexp_f16
exp_f16 :: proc(x: f16) -> (f16)Sourceexp_f16be
exp_f16be :: proc(x: f16be) -> (f16be)Sourceexp_f16le
exp_f16le :: proc(x: f16le) -> (f16le)Sourceexp_f32
exp_f32 :: proc(x: f32) -> (f32)Sourceexp_f32be
exp_f32be :: proc(x: f32be) -> (f32be)Sourceexp_f32le
exp_f32le :: proc(x: f32le) -> (f32le)Sourceexp_f64
exp_f64 :: proc(x: f64) -> (f64)Sourceexp_f64be
exp_f64be :: proc(x: f64be) -> (f64be)Sourceexp_f64le
exp_f64le :: proc(x: f64le) -> (f64le)Sourcefactorial
factorial :: proc(n: int) -> (int)Sourcefloor_div
floor_div :: proc(x: T, y: T) -> (T)Sourcefloor_divmod
floor_divmod :: proc(x: T, y: T) -> (div: T, mod: T)Sourcefloor_f16
floor_f16 :: proc(x: f16) -> (f16)Sourcefloor_f16be
floor_f16be :: proc(x: f16be) -> (f16be)Sourcefloor_f16le
floor_f16le :: proc(x: f16le) -> (f16le)Sourcefloor_f32
floor_f32 :: proc(x: f32) -> (f32)Sourcefloor_f32be
floor_f32be :: proc(x: f32be) -> (f32be)Sourcefloor_f32le
floor_f32le :: proc(x: f32le) -> (f32le)Sourcefloor_f64
floor_f64 :: proc(x: f64) -> (f64)Sourcefloor_f64be
floor_f64be :: proc(x: f64be) -> (f64be)Sourcefloor_f64le
floor_f64le :: proc(x: f64le) -> (f64le)Sourcefloor_mod
floor_mod :: proc(x: T, y: T) -> (T)Sourcefmuladd_f16
fmuladd_f16 :: proc(a: f16, b: f16, c: f16) -> (f16)Sourcefmuladd_f16be
fmuladd_f16be :: proc(a: f16be, b: f16be, c: f16be) -> (f16be)Sourcefmuladd_f16le
fmuladd_f16le :: proc(a: f16le, b: f16le, c: f16le) -> (f16le)Sourcefmuladd_f32
fmuladd_f32 :: proc(a: f32, b: f32, c: f32) -> (f32)Sourcefmuladd_f32be
fmuladd_f32be :: proc(a: f32be, b: f32be, c: f32be) -> (f32be)Sourcefmuladd_f32le
fmuladd_f32le :: proc(a: f32le, b: f32le, c: f32le) -> (f32le)Sourcefmuladd_f64
fmuladd_f64 :: proc(a: f64, b: f64, c: f64) -> (f64)Sourcefmuladd_f64be
fmuladd_f64be :: proc(a: f64be, b: f64be, c: f64be) -> (f64be)Sourcefmuladd_f64le
fmuladd_f64le :: proc(a: f64le, b: f64le, c: f64le) -> (f64le)Sourcefrexp_f16
frexp_f16 :: proc(x: f16) -> (significand: f16, exponent: int)Sourcefrexp_f16be
frexp_f16be :: proc(x: f16be) -> (significand: f16be, exponent: int)Sourcefrexp_f16le
frexp_f16le :: proc(x: f16le) -> (significand: f16le, exponent: int)Sourcefrexp_f32
frexp_f32 :: proc(x: f32) -> (significand: f32, exponent: int)Sourcefrexp_f32be
frexp_f32be :: proc(x: f32be) -> (significand: f32be, exponent: int)Sourcefrexp_f32le
frexp_f32le :: proc(x: f32le) -> (significand: f32le, exponent: int)Sourcefrexp_f64
frexp_f64 :: proc(f: f64) -> (significand: f64, exponent: int)Sourcefrexp_f64be
frexp_f64be :: proc(x: f64be) -> (significand: f64be, exponent: int)Sourcefrexp_f64le
frexp_f64le :: proc(x: f64le) -> (significand: f64le, exponent: int)Sourcegain
gain :: proc(t: T, g: T) -> (T)Sourcegamma_f16
gamma_f16 :: proc(x: f16) -> (f16)Sourcegamma_f16be
gamma_f16be :: proc(x: f16be) -> (f16be)Sourcegamma_f16le
gamma_f16le :: proc(x: f16le) -> (f16le)Sourcegamma_f32
gamma_f32 :: proc(x: f32) -> (f32)Sourcegamma_f32be
gamma_f32be :: proc(x: f32be) -> (f32be)Sourcegamma_f32le
gamma_f32le :: proc(x: f32le) -> (f32le)Sourcegamma_f64
gamma_f64 :: proc(x: f64) -> (f64)Sourcegamma_f64be
gamma_f64be :: proc(x: f64be) -> (f64be)Sourcegamma_f64le
gamma_f64le :: proc(x: f64le) -> (f64le)Sourcegcd
gcd :: proc(x: T, y: T) -> (T)Sourcehypot_f16
hypot_f16 :: proc(x: f16, y: f16) -> (r: f16)Sourcehypot_f16be
hypot_f16be :: proc(x: f16be, y: f16be) -> (r: f16be)Sourcehypot_f16le
hypot_f16le :: proc(x: f16le, y: f16le) -> (r: f16le)Sourcehypot_f32
hypot_f32 :: proc(x: f32, y: f32) -> (r: f32)Sourcehypot_f32be
hypot_f32be :: proc(x: f32be, y: f32be) -> (r: f32be)Sourcehypot_f32le
hypot_f32le :: proc(x: f32le, y: f32le) -> (r: f32le)Sourcehypot_f64
hypot_f64 :: proc(x: f64, y: f64) -> (r: f64)Sourcehypot_f64be
hypot_f64be :: proc(x: f64be, y: f64be) -> (r: f64be)Sourcehypot_f64le
hypot_f64le :: proc(x: f64le, y: f64le) -> (r: f64le)Sourceilogb_f16
ilogb_f16 :: proc(val: f16) -> (int)Sourceilogb_f16be
ilogb_f16be :: proc(value: f16be) -> (int)Sourceilogb_f16le
ilogb_f16le :: proc(value: f16le) -> (int)Sourceilogb_f32
ilogb_f32 :: proc(val: f32) -> (int)Sourceilogb_f32be
ilogb_f32be :: proc(value: f32be) -> (int)Sourceilogb_f32le
ilogb_f32le :: proc(value: f32le) -> (int)Sourceilogb_f64
ilogb_f64 :: proc(val: f64) -> (int)Sourceilogb_f64be
ilogb_f64be :: proc(value: f64be) -> (int)Sourceilogb_f64le
ilogb_f64le :: proc(value: f64le) -> (int)Sourceinf_f16
inf_f16 :: proc(sign: int) -> (f16)Sourceinf_f16be
inf_f16be :: proc(sign: int) -> (f16be)Sourceinf_f16le
inf_f16le :: proc(sign: int) -> (f16le)Sourceinf_f32
inf_f32 :: proc(sign: int) -> (f32)Sourceinf_f32be
inf_f32be :: proc(sign: int) -> (f32be)Sourceinf_f32le
inf_f32le :: proc(sign: int) -> (f32le)Sourceinf_f64
inf_f64 :: proc(sign: int) -> (f64)Sourceinf_f64be
inf_f64be :: proc(sign: int) -> (f64be)Sourceinf_f64le
inf_f64le :: proc(sign: int) -> (f64le)Sourceis_inf_f16
is_inf_f16 :: proc(x: f16, sign: int) -> (bool)Sourceis_inf reports whether f is an infinity, according to sign. If sign > 0, is_inf reports whether f is positive infinity. If sign < 0, is_inf reports whether f is negative infinity. If sign == 0, is_inf reports whether f is either infinity.
is_inf_f16be
is_inf_f16be :: proc(x: f16be, sign: int) -> (bool)Sourceis_inf_f16le
is_inf_f16le :: proc(x: f16le, sign: int) -> (bool)Sourceis_inf_f32
is_inf_f32 :: proc(x: f32, sign: int) -> (bool)Sourceis_inf_f32be
is_inf_f32be :: proc(x: f32be, sign: int) -> (bool)Sourceis_inf_f32le
is_inf_f32le :: proc(x: f32le, sign: int) -> (bool)Sourceis_inf_f64
is_inf_f64 :: proc(x: f64, sign: int) -> (bool)Sourceis_inf_f64be
is_inf_f64be :: proc(x: f64be, sign: int) -> (bool)Sourceis_inf_f64le
is_inf_f64le :: proc(x: f64le, sign: int) -> (bool)Sourceis_nan_f16
is_nan_f16 :: proc(x: f16) -> (bool)Sourceis_nan_f16be
is_nan_f16be :: proc(x: f16be) -> (bool)Sourceis_nan_f16le
is_nan_f16le :: proc(x: f16le) -> (bool)Sourceis_nan_f32
is_nan_f32 :: proc(x: f32) -> (bool)Sourceis_nan_f32be
is_nan_f32be :: proc(x: f32be) -> (bool)Sourceis_nan_f32le
is_nan_f32le :: proc(x: f32le) -> (bool)Sourceis_nan_f64
is_nan_f64 :: proc(x: f64) -> (bool)Sourceis_nan_f64be
is_nan_f64be :: proc(x: f64be) -> (bool)Sourceis_nan_f64le
is_nan_f64le :: proc(x: f64le) -> (bool)Sourceis_power_of_two
is_power_of_two :: proc(x: int) -> (bool)Sourcelcm
lcm :: proc(x: T, y: T) -> (T)Sourceldexp_f16
ldexp_f16 :: proc(val: f16, exp: int) -> (f16)Sourceldexp_f16be
ldexp_f16be :: proc(val: f16be, exp: int) -> (f16be)Sourceldexp_f16le
ldexp_f16le :: proc(val: f16le, exp: int) -> (f16le)Sourceldexp_f32
ldexp_f32 :: proc(val: f32, exp: int) -> (f32)Sourceldexp_f32be
ldexp_f32be :: proc(val: f32be, exp: int) -> (f32be)Sourceldexp_f32le
ldexp_f32le :: proc(val: f32le, exp: int) -> (f32le)Sourceldexp_f64
ldexp_f64 :: proc(val: f64, exp: int) -> (f64)Sourceldexp_f64be
ldexp_f64be :: proc(val: f64be, exp: int) -> (f64be)Sourceldexp_f64le
ldexp_f64le :: proc(val: f64le, exp: int) -> (f64le)Sourcelerp
lerp :: proc(a: T, b: T, t: E) -> (x: T)Sourcelgamma_f16
lgamma_f16 :: proc(x: f16) -> (lgamma: f16, sign: int)Sourcelgamma_f16be
lgamma_f16be :: proc(x: f16be) -> (lgamma: f16be, sign: int)Sourcelgamma_f16le
lgamma_f16le :: proc(x: f16le) -> (lgamma: f16le, sign: int)Sourcelgamma_f32
lgamma_f32 :: proc(x: f32) -> (lgamma: f32, sign: int)Sourcelgamma_f32be
lgamma_f32be :: proc(x: f32be) -> (lgamma: f32be, sign: int)Sourcelgamma_f32le
lgamma_f32le :: proc(x: f32le) -> (lgamma: f32le, sign: int)Sourcelgamma_f64
lgamma_f64 :: proc(x: f64) -> (lgamma: f64, sign: int)Sourcelgamma_f64be
lgamma_f64be :: proc(x: f64be) -> (lgamma: f64be, sign: int)Sourcelgamma_f64le
lgamma_f64le :: proc(x: f64le) -> (lgamma: f64le, sign: int)Sourceln_f16
ln_f16 :: proc(x: f16) -> (f16)Sourceln_f16be
ln_f16be :: proc(x: f16be) -> (f16be)Sourceln_f16le
ln_f16le :: proc(x: f16le) -> (f16le)Sourceln_f32
ln_f32 :: proc(x: f32) -> (f32)Sourceln_f32be
ln_f32be :: proc(x: f32be) -> (f32be)Sourceln_f32le
ln_f32le :: proc(x: f32le) -> (f32le)Sourceln_f64
ln_f64 :: proc(x: f64) -> (f64)Sourceln_f64be
ln_f64be :: proc(x: f64be) -> (f64be)Sourceln_f64le
ln_f64le :: proc(x: f64le) -> (f64le)Sourcelog10_f16
log10_f16 :: proc(x: f16) -> (f16)Sourcelog10_f16be
log10_f16be :: proc(x: f16be) -> (f16be)Sourcelog10_f16le
log10_f16le :: proc(x: f16le) -> (f16le)Sourcelog10_f32
log10_f32 :: proc(x: f32) -> (f32)Sourcelog10_f32be
log10_f32be :: proc(x: f32be) -> (f32be)Sourcelog10_f32le
log10_f32le :: proc(x: f32le) -> (f32le)Sourcelog10_f64
log10_f64 :: proc(x: f64) -> (f64)Sourcelog10_f64be
log10_f64be :: proc(x: f64be) -> (f64be)Sourcelog10_f64le
log10_f64le :: proc(x: f64le) -> (f64le)Sourcelog1p_f16
log1p_f16 :: proc(x: f16) -> (f16)Sourcelog1p_f16be
log1p_f16be :: proc(x: f16be) -> (f16be)Sourcelog1p_f16le
log1p_f16le :: proc(x: f16le) -> (f16le)Sourcelog1p_f32
log1p_f32 :: proc(x: f32) -> (f32)Sourcelog1p_f32be
log1p_f32be :: proc(x: f32be) -> (f32be)Sourcelog1p_f32le
log1p_f32le :: proc(x: f32le) -> (f32le)Sourcelog1p_f64
log1p_f64 :: proc(x: f64) -> (f64)Sourcelog1p_f64be
log1p_f64be :: proc(x: f64be) -> (f64be)Sourcelog1p_f64le
log1p_f64le :: proc(x: f64le) -> (f64le)Sourcelog2_f16
log2_f16 :: proc(x: f16) -> (f16)Sourcelog2_f16be
log2_f16be :: proc(x: f16be) -> (f16be)Sourcelog2_f16le
log2_f16le :: proc(x: f16le) -> (f16le)Sourcelog2_f32
log2_f32 :: proc(x: f32) -> (f32)Sourcelog2_f32be
log2_f32be :: proc(x: f32be) -> (f32be)Sourcelog2_f32le
log2_f32le :: proc(x: f32le) -> (f32le)Sourcelog2_f64
log2_f64 :: proc(x: f64) -> (f64)Sourcelog2_f64be
log2_f64be :: proc(x: f64be) -> (f64be)Sourcelog2_f64le
log2_f64le :: proc(x: f64le) -> (f64le)Sourcelog_f16
log_f16 :: proc(x: f16, base: f16) -> (f16)Sourcelog_f16be
log_f16be :: proc(x: f16be, base: f16be) -> (f16be)Sourcelog_f16le
log_f16le :: proc(x: f16le, base: f16le) -> (f16le)Sourcelog_f32
log_f32 :: proc(x: f32, base: f32) -> (f32)Sourcelog_f32be
log_f32be :: proc(x: f32be, base: f32be) -> (f32be)Sourcelog_f32le
log_f32le :: proc(x: f32le, base: f32le) -> (f32le)Sourcelog_f64
log_f64 :: proc(x: f64, base: f64) -> (f64)Sourcelog_f64be
log_f64be :: proc(x: f64be, base: f64be) -> (f64be)Sourcelog_f64le
log_f64le :: proc(x: f64le, base: f64le) -> (f64le)Sourcelogb_f16
logb_f16 :: proc(val: f16) -> (f16)Sourcelogb_f16be
logb_f16be :: proc(value: f16be) -> (f16be)Sourcelogb_f16le
logb_f16le :: proc(value: f16le) -> (f16le)Sourcelogb_f32
logb_f32 :: proc(val: f32) -> (f32)Sourcelogb_f32be
logb_f32be :: proc(value: f32be) -> (f32be)Sourcelogb_f32le
logb_f32le :: proc(value: f32le) -> (f32le)Sourcelogb_f64
logb_f64 :: proc(val: f64) -> (f64)Sourcelogb_f64be
logb_f64be :: proc(value: f64be) -> (f64be)Sourcelogb_f64le
logb_f64le :: proc(value: f64le) -> (f64le)Sourcemod_f16
mod_f16 :: proc(x: f16, y: f16) -> (n: f16)Sourcemod_f16be
mod_f16be :: proc(x: f16be, y: f16be) -> (n: f16be)Sourcemod_f16le
mod_f16le :: proc(x: f16le, y: f16le) -> (n: f16le)Sourcemod_f32
mod_f32 :: proc(x: f32, y: f32) -> (n: f32)Sourcemod_f32be
mod_f32be :: proc(x: f32be, y: f32be) -> (n: f32be)Sourcemod_f32le
mod_f32le :: proc(x: f32le, y: f32le) -> (n: f32le)Sourcemod_f64
mod_f64 :: proc(x: f64, y: f64) -> (n: f64)Sourcemod_f64be
mod_f64be :: proc(x: f64be, y: f64be) -> (n: f64be)Sourcemod_f64le
mod_f64le :: proc(x: f64le, y: f64le) -> (n: f64le)Sourcemodf_f16
modf_f16 :: proc(x: f16) -> (int: f16, frac: f16)Sourcemodf_f16be
modf_f16be :: proc(x: f16be) -> (int: f16be, frac: f16be)Sourcemodf_f16le
modf_f16le :: proc(x: f16le) -> (int: f16le, frac: f16le)Sourcemodf_f32
modf_f32 :: proc(x: f32) -> (int: f32, frac: f32)Sourcemodf_f32be
modf_f32be :: proc(x: f32be) -> (int: f32be, frac: f32be)Sourcemodf_f32le
modf_f32le :: proc(x: f32le) -> (int: f32le, frac: f32le)Sourcemodf_f64
modf_f64 :: proc(x: f64) -> (int: f64, frac: f64)Sourcemodf_f64be
modf_f64be :: proc(x: f64be) -> (int: f64be, frac: f64be)Sourcemodf_f64le
modf_f64le :: proc(x: f64le) -> (int: f64le, frac: f64le)Sourcenan_f16
nan_f16 :: proc() -> (f16)Sourcenan_f16be
nan_f16be :: proc() -> (f16be)Sourcenan_f16le
nan_f16le :: proc() -> (f16le)Sourcenan_f32
nan_f32 :: proc() -> (f32)Sourcenan_f32be
nan_f32be :: proc() -> (f32be)Sourcenan_f32le
nan_f32le :: proc() -> (f32le)Sourcenan_f64
nan_f64 :: proc() -> (f64)Sourcenan_f64be
nan_f64be :: proc() -> (f64be)Sourcenan_f64le
nan_f64le :: proc() -> (f64le)Sourcenext_power_of_two
next_power_of_two :: proc(x: int) -> (int)Sourcenextafter_f16
nextafter_f16 :: proc(x: f16, y: f16) -> (r: f16)Sourcenextafter_f16be
nextafter_f16be :: proc(x: f16be, y: f16be) -> (r: f16be)Sourcenextafter_f16le
nextafter_f16le :: proc(x: f16le, y: f16le) -> (r: f16le)Sourcenextafter_f32
nextafter_f32 :: proc(x: f32, y: f32) -> (r: f32)Sourcenextafter_f32be
nextafter_f32be :: proc(x: f32be, y: f32be) -> (r: f32be)Sourcenextafter_f32le
nextafter_f32le :: proc(x: f32le, y: f32le) -> (r: f32le)Sourcenextafter_f64
nextafter_f64 :: proc(x: f64, y: f64) -> (r: f64)Sourcenextafter_f64be
nextafter_f64be :: proc(x: f64be, y: f64be) -> (r: f64be)Sourcenextafter_f64le
nextafter_f64le :: proc(x: f64le, y: f64le) -> (r: f64le)Sourcenormalize_f16
normalize_f16 :: proc(x: f16) -> (y: f16, exponent: int)Sourcenormalize_f16be
normalize_f16be :: proc(x: f16be) -> (y: f16be, exponent: int)Sourcenormalize_f16le
normalize_f16le :: proc(x: f16le) -> (y: f16le, exponent: int)Sourcenormalize_f32
normalize_f32 :: proc(x: f32) -> (y: f32, exponent: int)Sourcenormalize_f32be
normalize_f32be :: proc(x: f32be) -> (y: f32be, exponent: int)Sourcenormalize_f32le
normalize_f32le :: proc(x: f32le) -> (y: f32le, exponent: int)Sourcenormalize_f64
normalize_f64 :: proc(x: f64) -> (y: f64, exponent: int)Sourcenormalize_f64be
normalize_f64be :: proc(x: f64be) -> (y: f64be, exponent: int)Sourcenormalize_f64le
normalize_f64le :: proc(x: f64le) -> (y: f64le, exponent: int)Sourcepow10_f16
pow10_f16 :: proc(n: f16) -> (f16)Sourcepow10_f16be
pow10_f16be :: proc(x: f16be) -> (f16be)Sourcepow10_f16le
pow10_f16le :: proc(x: f16le) -> (f16le)Sourcepow10_f32
pow10_f32 :: proc(n: f32) -> (f32)Sourcepow10_f32be
pow10_f32be :: proc(x: f32be) -> (f32be)Sourcepow10_f32le
pow10_f32le :: proc(x: f32le) -> (f32le)Sourcepow10_f64
pow10_f64 :: proc(n: f64) -> (f64)Sourcepow10_f64be
pow10_f64be :: proc(x: f64be) -> (f64be)Sourcepow10_f64le
pow10_f64le :: proc(x: f64le) -> (f64le)Sourcepow2_f16
pow2_f16 :: proc(exp: int) -> (res: f16)Sourcepow2_f32
pow2_f32 :: proc(exp: int) -> (res: f32)Sourcepow2_f64
pow2_f64 :: proc(exp: int) -> (res: f64)Sourcepow_f16
pow_f16 :: proc(x: f16, power: f16) -> (f16)Sourcepow_f16be
pow_f16be :: proc(x: f16be, power: f16be) -> (f16be)Sourcepow_f16le
pow_f16le :: proc(x: f16le, power: f16le) -> (f16le)Sourcepow_f32
pow_f32 :: proc(x: f32, power: f32) -> (f32)Sourcepow_f32be
pow_f32be :: proc(x: f32be, power: f32be) -> (f32be)Sourcepow_f32le
pow_f32le :: proc(x: f32le, power: f32le) -> (f32le)Sourcepow_f64
pow_f64 :: proc(x: f64, power: f64) -> (f64)Sourcepow_f64be
pow_f64be :: proc(x: f64be, power: f64be) -> (f64be)Sourcepow_f64le
pow_f64le :: proc(x: f64le, power: f64le) -> (f64le)Sourceprod
prod :: proc(x: T) -> (res: E)Sourceremainder_f16
remainder_f16 :: proc(x: f16, y: f16) -> (f16)Sourceremainder_f16be
remainder_f16be :: proc(x: f16be, y: f16be) -> (f16be)Sourceremainder_f16le
remainder_f16le :: proc(x: f16le, y: f16le) -> (f16le)Sourceremainder_f32
remainder_f32 :: proc(x: f32, y: f32) -> (f32)Sourceremainder_f32be
remainder_f32be :: proc(x: f32be, y: f32be) -> (f32be)Sourceremainder_f32le
remainder_f32le :: proc(x: f32le, y: f32le) -> (f32le)Sourceremainder_f64
remainder_f64 :: proc(x: f64, y: f64) -> (f64)Sourceremainder_f64be
remainder_f64be :: proc(x: f64be, y: f64be) -> (f64be)Sourceremainder_f64le
remainder_f64le :: proc(x: f64le, y: f64le) -> (f64le)Sourceremap
remap :: proc(old_value: T, old_min: T, old_max: T, new_min: T, new_max: T) -> (x: T)Sourceremap_clamped
remap_clamped :: proc(old_value: T, old_min: T, old_max: T, new_min: T, new_max: T) -> (x: T)Sourceround_f16
round_f16 :: proc(x: f16) -> (f16)Sourceround_f16be
round_f16be :: proc(x: f16be) -> (f16be)Sourceround_f16le
round_f16le :: proc(x: f16le) -> (f16le)Sourceround_f32
round_f32 :: proc(x: f32) -> (f32)Sourceround_f32be
round_f32be :: proc(x: f32be) -> (f32be)Sourceround_f32le
round_f32le :: proc(x: f32le) -> (f32le)Sourceround_f64
round_f64 :: proc(x: f64) -> (f64)Sourceround_f64be
round_f64be :: proc(x: f64be) -> (f64be)Sourceround_f64le
round_f64le :: proc(x: f64le) -> (f64le)Sourcesaturate
saturate :: proc(a: T) -> (x: T)Sourcesign_bit_f16
sign_bit_f16 :: proc(x: f16) -> (bool)Sourcesign_bit_f16be
sign_bit_f16be :: proc(x: f16be) -> (bool)Sourcesign_bit_f16le
sign_bit_f16le :: proc(x: f16le) -> (bool)Sourcesign_bit_f32
sign_bit_f32 :: proc(x: f32) -> (bool)Sourcesign_bit_f32be
sign_bit_f32be :: proc(x: f32be) -> (bool)Sourcesign_bit_f32le
sign_bit_f32le :: proc(x: f32le) -> (bool)Sourcesign_bit_f64
sign_bit_f64 :: proc(x: f64) -> (bool)Sourcesign_bit_f64be
sign_bit_f64be :: proc(x: f64be) -> (bool)Sourcesign_bit_f64le
sign_bit_f64le :: proc(x: f64le) -> (bool)Sourcesign_bit_i16
sign_bit_i16 :: proc(x: i16) -> (bool)Sourcesign_bit_i16be
sign_bit_i16be :: proc(x: i16be) -> (bool)Sourcesign_bit_i16le
sign_bit_i16le :: proc(x: i16le) -> (bool)Sourcesign_bit_i32
sign_bit_i32 :: proc(x: i32) -> (bool)Sourcesign_bit_i32be
sign_bit_i32be :: proc(x: i32be) -> (bool)Sourcesign_bit_i32le
sign_bit_i32le :: proc(x: i32le) -> (bool)Sourcesign_bit_i64
sign_bit_i64 :: proc(x: i64) -> (bool)Sourcesign_bit_i64be
sign_bit_i64be :: proc(x: i64be) -> (bool)Sourcesign_bit_i64le
sign_bit_i64le :: proc(x: i64le) -> (bool)Sourcesign_bit_int
sign_bit_int :: proc(x: int) -> (bool)Sourcesign_f16
sign_f16 :: proc(x: f16) -> (f16)Sourcesign_f16be
sign_f16be :: proc(x: f16be) -> (f16be)Sourcesign_f16le
sign_f16le :: proc(x: f16le) -> (f16le)Sourcesign_f32
sign_f32 :: proc(x: f32) -> (f32)Sourcesign_f32be
sign_f32be :: proc(x: f32be) -> (f32be)Sourcesign_f32le
sign_f32le :: proc(x: f32le) -> (f32le)Sourcesign_f64
sign_f64 :: proc(x: f64) -> (f64)Sourcesign_f64be
sign_f64be :: proc(x: f64be) -> (f64be)Sourcesign_f64le
sign_f64le :: proc(x: f64le) -> (f64le)Sourcesign_i16
sign_i16 :: proc(x: i16) -> (i16)Sourcesign_i16be
sign_i16be :: proc(x: i16be) -> (i16be)Sourcesign_i16le
sign_i16le :: proc(x: i16le) -> (i16le)Sourcesign_i32
sign_i32 :: proc(x: i32) -> (i32)Sourcesign_i32be
sign_i32be :: proc(x: i32be) -> (i32be)Sourcesign_i32le
sign_i32le :: proc(x: i32le) -> (i32le)Sourcesign_i64
sign_i64 :: proc(x: i64) -> (i64)Sourcesign_i64be
sign_i64be :: proc(x: i64be) -> (i64be)Sourcesign_i64le
sign_i64le :: proc(x: i64le) -> (i64le)Sourcesign_int
sign_int :: proc(x: int) -> (int)Sourcesin_f16
sin_f16 :: proc() -> (f16)Sourcesin_f16be
sin_f16be :: proc() -> (f16be)Sourcesin_f16le
sin_f16le :: proc() -> (f16le)Sourcesin_f32
sin_f32 :: proc() -> (f32)Sourcesin_f32be
sin_f32be :: proc() -> (f32be)Sourcesin_f32le
sin_f32le :: proc() -> (f32le)Sourcesin_f64
sin_f64 :: proc() -> (f64)Sourcesin_f64be
sin_f64be :: proc() -> (f64be)Sourcesin_f64le
sin_f64le :: proc() -> (f64le)Sourcesincos_f16
sincos_f16 :: proc(x: f16) -> (sin: f16, cos: f16)Sourcesincos_f16be
sincos_f16be :: proc(x: f16be) -> (sin: f16be, cos: f16be)Sourcesincos_f16le
sincos_f16le :: proc(x: f16le) -> (sin: f16le, cos: f16le)Sourcesincos_f32
sincos_f32 :: proc(x: f32) -> (sin: f32, cos: f32)Sourcesincos_f32be
sincos_f32be :: proc(x: f32be) -> (sin: f32be, cos: f32be)Sourcesincos_f32le
sincos_f32le :: proc(x: f32le) -> (sin: f32le, cos: f32le)Sourcesincos_f64
sincos_f64 :: proc(x: f64) -> (sin: f64, cos: f64)Sourcesincos_f64be
sincos_f64be :: proc(x: f64be) -> (sin: f64be, cos: f64be)Sourcesincos_f64le
sincos_f64le :: proc(x: f64le) -> (sin: f64le, cos: f64le)Sourcesinh
sinh :: proc(x: T) -> (T)Sourcesmoothstep
smoothstep :: proc(edge0: T, edge1: T, x: T) -> (T)Sourcesqrt_f16
sqrt_f16 :: proc(x: f16) -> (f16)Sourcesqrt_f16be
sqrt_f16be :: proc(x: f16be) -> (f16be)Sourcesqrt_f16le
sqrt_f16le :: proc(x: f16le) -> (f16le)Sourcesqrt_f32
sqrt_f32 :: proc(x: f32) -> (f32)Sourcesqrt_f32be
sqrt_f32be :: proc(x: f32be) -> (f32be)Sourcesqrt_f32le
sqrt_f32le :: proc(x: f32le) -> (f32le)Sourcesqrt_f64
sqrt_f64 :: proc(x: f64) -> (f64)Sourcesqrt_f64be
sqrt_f64be :: proc(x: f64be) -> (f64be)Sourcesqrt_f64le
sqrt_f64le :: proc(x: f64le) -> (f64le)Sourcestep
step :: proc(edge: T, x: T) -> (T)Sourcesum
sum :: proc(x: T) -> (res: E)Sourcetan_f16
tan_f16 :: proc() -> (f16)Sourcetan_f16be
tan_f16be :: proc() -> (f16be)Sourcetan_f16le
tan_f16le :: proc() -> (f16le)Sourcetan_f32
tan_f32 :: proc() -> (f32)Sourcetan_f32be
tan_f32be :: proc() -> (f32be)Sourcetan_f32le
tan_f32le :: proc() -> (f32le)Sourcetan_f64
tan_f64 :: proc() -> (f64)Sourcetan_f64be
tan_f64be :: proc() -> (f64be)Sourcetan_f64le
tan_f64le :: proc() -> (f64le)Sourcetanh
tanh :: proc(y: T) -> (T)Sourceto_degrees_f16
to_degrees_f16 :: proc(radians: f16) -> (f16)Sourceto_degrees_f16be
to_degrees_f16be :: proc(radians: f16be) -> (f16be)Sourceto_degrees_f16le
to_degrees_f16le :: proc(radians: f16le) -> (f16le)Sourceto_degrees_f32
to_degrees_f32 :: proc(radians: f32) -> (f32)Sourceto_degrees_f32be
to_degrees_f32be :: proc(radians: f32be) -> (f32be)Sourceto_degrees_f32le
to_degrees_f32le :: proc(radians: f32le) -> (f32le)Sourceto_degrees_f64
to_degrees_f64 :: proc(radians: f64) -> (f64)Sourceto_degrees_f64be
to_degrees_f64be :: proc(radians: f64be) -> (f64be)Sourceto_degrees_f64le
to_degrees_f64le :: proc(radians: f64le) -> (f64le)Sourceto_radians_f16
to_radians_f16 :: proc(degrees: f16) -> (f16)Sourceto_radians_f16be
to_radians_f16be :: proc(degrees: f16be) -> (f16be)Sourceto_radians_f16le
to_radians_f16le :: proc(degrees: f16le) -> (f16le)Sourceto_radians_f32
to_radians_f32 :: proc(degrees: f32) -> (f32)Sourceto_radians_f32be
to_radians_f32be :: proc(degrees: f32be) -> (f32be)Sourceto_radians_f32le
to_radians_f32le :: proc(degrees: f32le) -> (f32le)Sourceto_radians_f64
to_radians_f64 :: proc(degrees: f64) -> (f64)Sourceto_radians_f64be
to_radians_f64be :: proc(degrees: f64be) -> (f64be)Sourceto_radians_f64le
to_radians_f64le :: proc(degrees: f64le) -> (f64le)Sourcetrunc_f16
trunc_f16 :: proc(x: f16) -> (f16)Sourcetrunc_f16be
trunc_f16be :: proc(x: f16be) -> (f16be)Sourcetrunc_f16le
trunc_f16le :: proc(x: f16le) -> (f16le)Sourcetrunc_f32
trunc_f32 :: proc(x: f32) -> (f32)Sourcetrunc_f32be
trunc_f32be :: proc(x: f32be) -> (f32be)Sourcetrunc_f32le
trunc_f32le :: proc(x: f32le) -> (f32le)Sourcetrunc_f64
trunc_f64 :: proc(x: f64) -> (f64)Sourcetrunc_f64be
trunc_f64be :: proc(x: f64be) -> (f64be)Sourcetrunc_f64le
trunc_f64le :: proc(x: f64le) -> (f64le)Sourceunlerp
unlerp :: proc(a: T, b: T, x: T) -> (t: T)Sourcewrap
wrap :: proc(x: T, y: T) -> (T)SourceProcedure Groups
44acos
acos :: proc{acos_f64, acos_f32, acos_f16, acos_f64le, acos_f64be, acos_f32le, acos_f32be, acos_f16le, acos_f16be}SourceReturn the arc cosine of x, in radians. Defined on the domain of [-1, 1] with a range of [0, π].
asin
asin :: proc{asin_f64, asin_f32, asin_f16, asin_f64le, asin_f64be, asin_f32le, asin_f32be, asin_f16le, asin_f16be}SourceReturn the arc sine of x, in radians. Defined on the domain of [-1, 1] with a range of [-π/2, π/2]
atan2
atan2 :: proc{atan2_f64, atan2_f32, atan2_f16, atan2_f64le, atan2_f64be, atan2_f32le, atan2_f32be, atan2_f16le, atan2_f16be}SourceReturn the arc tangent of y/x in radians. Defined on the domain [-â, â] for x and y with a range of [-Ï, Ï]
Special cases:
atan2(y, NaN) = NaN
atan2(NaN, x) = NaN
atan2(+0, x>=0) = + 0
atan2(-0, x>=0) = - 0
atan2(+0, x<=-0) = + Ï
atan2(-0, x<=-0) = - Ï
atan2(y>0, 0) = + Ï/2
atan2(y<0, 0) = - Ï/2
atan2(+â, +â) = + Ï/4
atan2(-â, +â) = - Ï/4
atan2(+â, -â) = 3Ï/4
atan2(-â, -â) = - 3Ï/4
atan2(y, +â) = 0
atan2(y>0, -â) = + Ï
atan2(y<0, -â) = - Ï
atan2(+â, x) = + Ï/2
atan2(-â, x) = - Ï/2cbrt
cbrt :: proc{cbrt_f16, cbrt_f16le, cbrt_f16be, cbrt_f32, cbrt_f32le, cbrt_f32be, cbrt_f64, cbrt_f64le, cbrt_f64be}Sourcecbrt returns the cube root of x.
Special cases are:
cbrt(±0) = ±0
cbrt(±Inf) = ±Inf
cbrt(NaN) = NaNceil
ceil :: proc{ceil_f16, ceil_f16le, ceil_f16be, ceil_f32, ceil_f32le, ceil_f32be, ceil_f64, ceil_f64le, ceil_f64be}Sourceclassify
classify :: proc{classify_f16, classify_f16le, classify_f16be, classify_f32, classify_f32le, classify_f32be, classify_f64, classify_f64le, classify_f64be}SourceReturns the Float_Class of the value, i.e. whether normal, subnormal, zero, negative zero, NaN, infinity or negative infinity.
copy_sign
copy_sign :: proc{copy_sign_f16, copy_sign_f16le, copy_sign_f16be, copy_sign_f32, copy_sign_f32le, copy_sign_f32be, copy_sign_f64, copy_sign_f64le, copy_sign_f64be}Sourcecos
cos :: proc{cos_f16, cos_f16le, cos_f16be, cos_f32, cos_f32le, cos_f32be, cos_f64, cos_f64le, cos_f64be}SourceReturn the cosine of θ in radians.
erf
erf :: proc{erf_f16, erf_f16le, erf_f16be, erf_f32, erf_f32le, erf_f32be, erf_f64}SourceThe original C code and the long comment below are from FreeBSD's /usr/src/lib/msun/src/s_erf.c and came with this notice.
==================================================== Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
Developed at SunPro, a Sun Microsystems, Inc. business. Permission to use, copy, modify, and distribute this software is freely granted, provided that this notice is preserved. ====================================================
double erf(double x) double erfc(double x) x 2 |\ erf(x) = --------- | exp(-t*t)dt sqrt(pi) \| 0
erfc(x) = 1-erf(x) Note that erf(-x) = -erf(x) erfc(-x) = 2 - erfc(x)
Method: 1. For |x| in [0, 0.84375] erf(x) = x + xR(x2) erfc(x) = 1 - erf(x) if x in [-.84375,0.25] = 0.5 + ((0.5-x)-xR) if x in [0.25,0.84375] where R = P/Q where P is an odd poly of degree 8 and Q is an odd poly of degree 10. -57.90 | R - (erf(x)-x)/x | <= 2
Remark. The formula is derived by noting erf(x) = (2/sqrt(pi))(x - x3/3 + x5/10 - x*7/42 + ....) and that 2/sqrt(pi) = 1.128379167095512573896158903121545171688 is close to one. The interval is chosen because the fix point of erf(x) is near 0.6174 (i.e., erf(x)=x when x is near 0.6174), and by some experiment, 0.84375 is chosen to guarantee the error is less than one ulp for erf.
2. For |x| in [0.84375,1.25], let s = |x| - 1, and c = 0.84506291151 rounded to single (24 bits) erf(x) = sign(x) (c + P1(s)/Q1(s)) erfc(x) = (1-c) - P1(s)/Q1(s) if x > 0 1+(c+P1(s)/Q1(s)) if x < 0 |P1/Q1 - (erf(|x|)-c)| <= 2-59.06 Remark: here we use the taylor series expansion at x=1. erf(1+s) = erf(1) + sPoly(s) = 0.845.. + P1(s)/Q1(s) That is, we use rational approximation to approximate erf(1+s) - (c = (single)0.84506291151) Note that |P1/Q1|< 0.078 for x in [0.84375,1.25] where P1(s) = degree 6 poly in s Q1(s) = degree 6 poly in s
3. For x in [1.25,1/0.35(~2.857143)], erfc(x) = (1/x)exp(-xx-0.5625+R1/S1) erf(x) = 1 - erfc(x) where R1(z) = degree 7 poly in z, (z=1/x**2) S1(z) = degree 8 poly in z
4. For x in [1/0.35,28] erfc(x) = (1/x)exp(-xx-0.5625+R2/S2) if x > 0 = 2.0 - (1/x)exp(-xx-0.5625+R2/S2) if -6<x<0 = 2.0 - tiny (if x <= -6) erf(x) = sign(x)(1.0 - erfc(x)) if x < 6, else erf(x) = sign(x)(1.0 - tiny) where R2(z) = degree 6 poly in z, (z=1/x**2) S2(z) = degree 7 poly in z
Note1: To compute exp(-xx-0.5625+R/S), let s be a single precision number and s := x; then -xx = -ss + (s-x)(s+x) exp(-xx-0.5626+R/S) = exp(-ss-0.5625)exp((s-x)(s+x)+R/S); Note2: Here 4 and 5 make use of the asymptotic series exp(-xx) erfc(x) ~ ---------- ( 1 + Poly(1/x2) ) x*sqrt(pi) We use rational approximation to approximate g(s)=f(1/x2) = log(erfc(x)x) - xx + 0.5625 Here is the error bound for R1/S1 and R2/S2 |R1/S1 - f(x)| < 2(-62.57) |R2/S2 - f(x)| < 2(-61.52)
5. For inf > x >= 28 erf(x) = sign(x) (1 - tiny) (raise inexact) erfc(x) = tinytiny (raise underflow) if x > 0 = 2 - tiny if x<0
7. Special case: erf(0) = 0, erf(inf) = 1, erf(-inf) = -1, erfc(0) = 1, erfc(inf) = 0, erfc(-inf) = 2, erfc/erf(NaN) is NaN
erfc
erfc :: proc{erfc_f16, erfc_f16le, erfc_f16be, erfc_f32, erfc_f32le, erfc_f32be, erfc_f64}Sourceexp
exp :: proc{exp_f16, exp_f16le, exp_f16be, exp_f32, exp_f32le, exp_f32be, exp_f64, exp_f64le, exp_f64be}Sourcefloor
floor :: proc{floor_f16, floor_f16le, floor_f16be, floor_f32, floor_f32le, floor_f32be, floor_f64, floor_f64le, floor_f64be}Sourcefmuladd
fmuladd :: proc{fmuladd_f16, fmuladd_f16le, fmuladd_f16be, fmuladd_f32, fmuladd_f32le, fmuladd_f32be, fmuladd_f64, fmuladd_f64le, fmuladd_f64be}Sourcefrexp
frexp :: proc{frexp_f16, frexp_f16le, frexp_f16be, frexp_f32, frexp_f32le, frexp_f32be, frexp_f64, frexp_f64le, frexp_f64be}Sourcefrexp breaks the value into a normalized fraction, and an integral power of two It returns a significand and exponent satisfying x == significand 2*exponent with the absolute value of significand in the intervalue of [0.5, 1).
Special cases:
frexp(+0) = +0, 0
frexp(-0) = -0, 0
frexp(+inf) = +inf, 0
frexp(-inf) = -inf, 0
frexp(NaN) = NaN, 0gamma
gamma :: proc{gamma_f16, gamma_f16le, gamma_f16be, gamma_f32, gamma_f32le, gamma_f32be, gamma_f64, gamma_f64le, gamma_f64be}Sourcehypot
hypot :: proc{hypot_f16, hypot_f16le, hypot_f16be, hypot_f32, hypot_f32le, hypot_f32be, hypot_f64, hypot_f64le, hypot_f64be}Sourcehypot returns Sqrt(pp + qq), taking care to avoid unnecessary overflow and underflow.
Special cases:
hypot(±Inf, q) = +Inf
hypot(p, ±Inf) = +Inf
hypot(NaN, q) = NaN
hypot(p, NaN) = NaNilogb
ilogb :: proc{ilogb_f16, ilogb_f32, ilogb_f64, ilogb_f16le, ilogb_f16be, ilogb_f32le, ilogb_f32be, ilogb_f64le, ilogb_f64be}Sourceis_inf
is_inf :: proc{is_inf_f16, is_inf_f16le, is_inf_f16be, is_inf_f32, is_inf_f32le, is_inf_f32be, is_inf_f64, is_inf_f64le, is_inf_f64be}Sourceis_nan
is_nan :: proc{is_nan_f16, is_nan_f16le, is_nan_f16be, is_nan_f32, is_nan_f32le, is_nan_f32be, is_nan_f64, is_nan_f64le, is_nan_f64be}Sourceldexp
ldexp :: proc{ldexp_f16, ldexp_f16le, ldexp_f16be, ldexp_f32, ldexp_f32le, ldexp_f32be, ldexp_f64, ldexp_f64le, ldexp_f64be}Sourceldexp is the inverse of frexp it returns val 2*exp.
Special cases:
ldexp(+0, exp) = +0
ldexp(-0, exp) = -0
ldexp(+inf, exp) = +inf
ldexp(-inf, exp) = -inf
ldexp(NaN, exp) = NaNlgamma
lgamma :: proc{lgamma_f16, lgamma_f16le, lgamma_f16be, lgamma_f32, lgamma_f32le, lgamma_f32be, lgamma_f64, lgamma_f64le, lgamma_f64be}Sourceln
ln :: proc{ln_f16, ln_f16le, ln_f16be, ln_f32, ln_f32le, ln_f32be, ln_f64, ln_f64le, ln_f64be}Sourcelog
log :: proc{log_f16, log_f16le, log_f16be, log_f32, log_f32le, log_f32be, log_f64, log_f64le, log_f64be}Sourcelog10
log10 :: proc{log10_f16, log10_f16le, log10_f16be, log10_f32, log10_f32le, log10_f32be, log10_f64, log10_f64le, log10_f64be}Sourcelog1p
log1p :: proc{log1p_f16, log1p_f32, log1p_f64, log1p_f16le, log1p_f16be, log1p_f32le, log1p_f32be, log1p_f64le, log1p_f64be}SourceThe original C code, the long comment, and the constants below are from FreeBSD's /usr/src/lib/msun/src/s_log1p.c and came with this notice. The go code is a simplified version of the original C.
==================================================== Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved.
Developed at SunPro, a Sun Microsystems, Inc. business. Permission to use, copy, modify, and distribute this software is freely granted, provided that this notice is preserved. ====================================================
double log1p(double x)
Method : 1. Argument Reduction: find k and f such that 1+x = 2*k (1+f), where sqrt(2)/2 < 1+f < sqrt(2) .
Note. If k=0, then f=x is exact. However, if k!=0, then f may not be representable exactly. In that case, a correction term is need. Let u=1+x rounded. Let c = (1+x)-u, then log(1+x) - log(u) ~ c/u. Thus, we proceed to compute log(u), and add back the correction term c/u. (Note: when x > 2**53, one can simply return log(x))
2. Approximation of log1p(f). Let s = f/(2+f) ; based on log(1+f) = log(1+s) - log(1-s) = 2s + 2/3 s3 + 2/5 s5 + ....., = 2s + sR We use a special Reme algorithm on [0,0.1716] to generate a polynomial of degree 14 to approximate R The maximum error of this polynomial approximation is bounded by 2-58.45. In other words, 2 4 6 8 10 12 14 R(z) ~ Lp1s +Lp2s +Lp3s +Lp4s +Lp5s +Lp6s +Lp7s (the values of Lp1 to Lp7 are listed in the program) and | 2 14 | -58.45 | Lp1s +...+Lp7s - R(z) | <= 2
Note that 2s = f - sf = f - hfsq + shfsq, where hfsq = ff/2. In order to guarantee error in log below 1ulp, we compute log by log1p(f) = f - (hfsq - s(hfsq+R)).
3. Finally, log1p(x) = kln2 + log1p(f). = kln2_hi+(f-(hfsq-(s(hfsq+R)+kln2_lo))) Here ln2 is split into two floating point number: ln2_hi + ln2_lo, where n*ln2_hi is always exact for |n| < 2000.
Special cases: log1p(x) is NaN with signal if x < -1 (including -INF) ; log1p(+INF) is +INF; log1p(-1) is -INF with signal; log1p(NaN) is that NaN with no signal.
Accuracy: according to an error analysis, the error is always less than 1 ulp (unit in the last place).
Constants: The hexadecimal values are the intended ones for the following constants. The decimal values may be used, provided that the compiler will convert from decimal to binary accurately enough to produce the hexadecimal values shown.
Note: Assuming log() return accurate answer, the following algorithm can be used to compute log1p(x) to within a few ULP:
u = 1+x; if(u==1.0) return x ; else return log(u)*(x/(u-1.0));
See HP-15C Advanced Functions Handbook, p.193.
log2
log2 :: proc{log2_f16, log2_f16le, log2_f16be, log2_f32, log2_f32le, log2_f32be, log2_f64, log2_f64le, log2_f64be}Sourcelogb
logb :: proc{logb_f16, logb_f32, logb_f64, logb_f16le, logb_f16be, logb_f32le, logb_f32be, logb_f64le, logb_f64be}Sourcemod
mod :: proc{mod_f16, mod_f16le, mod_f16be, mod_f32, mod_f32le, mod_f32be, mod_f64, mod_f64le, mod_f64be}Sourcemodf
modf :: proc{modf_f16, modf_f16le, modf_f16be, modf_f32, modf_f32le, modf_f32be, modf_f64, modf_f64le, modf_f64be}Sourcenextafter
nextafter :: proc{nextafter_f16, nextafter_f16le, nextafter_f16be, nextafter_f32, nextafter_f32le, nextafter_f32be, nextafter_f64, nextafter_f64le, nextafter_f64be}Sourcenormalize
normalize :: proc{normalize_f16, normalize_f32, normalize_f64, normalize_f16le, normalize_f16be, normalize_f32le, normalize_f32be, normalize_f64le, normalize_f64be}Sourcepow
pow :: proc{pow_f16, pow_f16le, pow_f16be, pow_f32, pow_f32le, pow_f32be, pow_f64, pow_f64le, pow_f64be}Sourcepow10
pow10 :: proc{pow10_f16, pow10_f16le, pow10_f16be, pow10_f32, pow10_f32le, pow10_f32be, pow10_f64, pow10_f64le, pow10_f64be}Sourceremainder
remainder :: proc{remainder_f16, remainder_f16le, remainder_f16be, remainder_f32, remainder_f32le, remainder_f32be, remainder_f64, remainder_f64le, remainder_f64be}Sourceround
round :: proc{round_f16, round_f16le, round_f16be, round_f32, round_f32le, round_f32be, round_f64, round_f64le, round_f64be}Sourcesign
sign :: proc{sign_f16, sign_f16le, sign_f16be, sign_f32, sign_f32le, sign_f32be, sign_f64, sign_f64le, sign_f64be, sign_int, sign_i16, sign_i16le, sign_i16be, sign_i32, sign_i32le, sign_i32be, sign_i64, sign_i64le, sign_i64be}Sourcesign_bit
sign_bit :: proc{sign_bit_f16, sign_bit_f16le, sign_bit_f16be, sign_bit_f32, sign_bit_f32le, sign_bit_f32be, sign_bit_f64, sign_bit_f64le, sign_bit_f64be, sign_bit_int, sign_bit_i16, sign_bit_i16le, sign_bit_i16be, sign_bit_i32, sign_bit_i32le, sign_bit_i32be, sign_bit_i64, sign_bit_i64le, sign_bit_i64be}Sourcesin
sin :: proc{sin_f16, sin_f16le, sin_f16be, sin_f32, sin_f32le, sin_f32be, sin_f64, sin_f64le, sin_f64be}SourceReturn the sine of θ in radians.
sincos
sincos :: proc{sincos_f16, sincos_f16le, sincos_f16be, sincos_f32, sincos_f32le, sincos_f32be, sincos_f64, sincos_f64le, sincos_f64be}SourceThe original C code, the long comment, and the constants below were from http://netlib.sandia.gov/cephes/cmath/sin.c, available from http://www.netlib.org/cephes/cmath.tgz. The go code is a simplified version of the original C.
sin.c
Circular sine
SYNOPSIS:
double x, y, sin(); y = sin( x );
DESCRIPTION:
Range reduction is into intervals of pi/4. The reduction error is nearly eliminated by contriving an extended precision modular arithmetic.
Two polynomial approximating functions are employed. Between 0 and pi/4 the sine is approximated by x + x3 P(x2). Between pi/4 and pi/2 the cosine is represented as 1 - x2 Q(x2).
ACCURACY:
Relative error: arithmetic domain # trials peak rms DEC 0, 10 150000 3.0e-17 7.8e-18 IEEE -1.07e9,+1.07e9 130000 2.1e-16 5.4e-17
Partial loss of accuracy begins to occur at x = 230 = 1.074e9. The loss is not gradual, but jumps suddenly to about 1 part in 10e7. Results may be meaningless for x > 249 = 5.6e14.
cos.c
Circular cosine
SYNOPSIS:
double x, y, cos(); y = cos( x );
DESCRIPTION:
Range reduction is into intervals of pi/4. The reduction error is nearly eliminated by contriving an extended precision modular arithmetic.
Two polynomial approximating functions are employed. Between 0 and pi/4 the cosine is approximated by 1 - x2 Q(x2). Between pi/4 and pi/2 the sine is represented as x + x3 P(x2).
ACCURACY:
Relative error: arithmetic domain # trials peak rms IEEE -1.07e9,+1.07e9 130000 2.1e-16 5.4e-17 DEC 0,+1.07e9 17000 3.0e-17 7.2e-18
Cephes Math Library Release 2.8: June, 2000 Copyright 1984, 1987, 1989, 1992, 2000 by Stephen L. Moshier
The readme file at http://netlib.sandia.gov/cephes/ says: Some software in this archive may be from the book _Methods and Programs for Mathematical Functions_ (Prentice-Hall or Simon & Schuster International, 1989) or from the Cephes Mathematical Library, a commercial product. In either event, it is copyrighted by the author. What you see here may be used freely but it comes with no support or guarantee.
The two known misprints in the book are repaired here in the source listings for the gamma function and the incomplete beta integral.
Stephen L. Moshier moshier@na-net.ornl.gov
sqrt
sqrt :: proc{sqrt_f16, sqrt_f16le, sqrt_f16be, sqrt_f32, sqrt_f32le, sqrt_f32be, sqrt_f64, sqrt_f64le, sqrt_f64be}Sourcetan
tan :: proc{tan_f16, tan_f16le, tan_f16be, tan_f32, tan_f32le, tan_f32be, tan_f64, tan_f64le, tan_f64be}SourceReturn the tangent of θ in radians.
to_degrees
to_degrees :: proc{to_degrees_f16, to_degrees_f16le, to_degrees_f16be, to_degrees_f32, to_degrees_f32le, to_degrees_f32be, to_degrees_f64, to_degrees_f64le, to_degrees_f64be}Sourceto_radians
to_radians :: proc{to_radians_f16, to_radians_f16le, to_radians_f16be, to_radians_f32, to_radians_f32le, to_radians_f32be, to_radians_f64, to_radians_f64le, to_radians_f64be}Sourcetrunc
trunc :: proc{trunc_f16, trunc_f16le, trunc_f16be, trunc_f32, trunc_f32le, trunc_f32be, trunc_f64, trunc_f64le, trunc_f64be}SourceRemoves the fractional part of the value, i.e. rounds towards zero.