abla/math

Generated from source.

Import with import "abla/math".

Source: abla/math/entry.ab

min (fun)

fun min(left: int, right: int): int

Returns the smaller of left and right.

max (fun)

fun max(left: int, right: int): int

Returns the larger of left and right.

clamp (fun)

fun clamp(value: int, minimum: int, maximum: int): int

Bounds value by minimum and maximum. Returns maximum when the bounds are reversed.

ablaF64Sqrt (extern)

noescape extern:"intrinsic" fun ablaF64Sqrt(value: f64): f64

Returns the f64 square root, preserving signed zero and returning NaN for negative inputs other than negative zero.

ablaF64Floor (extern)

noescape extern:"intrinsic" fun ablaF64Floor(value: f64): f64

Returns the f64 value rounded down to a whole number.

ablaF64Ceil (extern)

noescape extern:"intrinsic" fun ablaF64Ceil(value: f64): f64

Returns the f64 value rounded up to a whole number.

ablaF64Trunc (extern)

noescape extern:"intrinsic" fun ablaF64Trunc(value: f64): f64

Returns the f64 value rounded toward zero to a whole number.

ablaF64Abs (extern)

noescape extern:"intrinsic" fun ablaF64Abs(value: f64): f64

Returns the f64 value with its sign bit cleared.

ablaF64RoundEven (extern)

noescape extern:"intrinsic" fun ablaF64RoundEven(value: f64): f64

Returns the nearest whole f64 value, rounding ties to even.

ablaF64Minimum (extern)

noescape extern:"intrinsic" fun ablaF64Minimum(left: f64, right: f64): f64

Returns the IEEE minimum, propagating NaN and ordering negative zero below positive zero.

ablaF64Maximum (extern)

noescape extern:"intrinsic" fun ablaF64Maximum(left: f64, right: f64): f64

Returns the IEEE maximum, propagating NaN and ordering positive zero above negative zero.

ablaF64Fma (extern)

noescape extern:"intrinsic" fun ablaF64Fma(x: f64, y: f64, z: f64): f64

Returns x * y + z using fused rounding when supported by the target.

ablaF64FmaIsFused (extern)

noescape extern:"intrinsic" fun ablaF64FmaIsFused(): bool

Returns true when the target provides a fused f64 multiply-add instruction.

mathPi (val)

val mathPi: f64

pi

mathHalfPi (val)

val mathHalfPi: f64

pi / 2

mathQuarterPi (val)

val mathQuarterPi: f64

pi / 4

mathTau (val)

val mathTau: f64

2 pi

__mathPiLo (val)

val __mathPiLo: f64

pi - mathPi

sqrt (fun)

fun sqrt(value: f64): f64

IEEE-754 operations that every target rounds identically: these lower to single instructions (or LLVM's exact expansions) on x86-64, AArch64 and Wasm. Returns the square root of value. Negative inputs produce NaN, and negative zero is preserved.

floor (fun)

fun floor(value: f64): f64

Rounds value down to a whole number in the same float type.

ceil (fun)

fun ceil(value: f64): f64

Rounds value up to a whole number in the same float type.

trunc (fun)

fun trunc(value: f64): f64

Rounds value toward zero to a whole number in the same float type.

fabs (fun)

fun fabs(value: f64): f64

Returns value with its sign bit cleared.

roundEven (fun)

fun roundEven(value: f64): f64

Round half to even (IEEE roundTiesToEven), e.g. 2.5 -> 2.0, 3.5 -> 4.0.

isNaN (fun)

fun isNaN(value: f64): bool

Returns true when value is NaN.

isFinite (fun)

fun isFinite(value: f64): bool

Returns true for finite value, including either signed zero.

fmin (fun)

fun fmin(left: f64, right: f64): f64

The smaller of two f64s as IEEE 754-2019 minimum: NaN if either is NaN, and -0.0 below 0.0.

fmax (fun)

fun fmax(left: f64, right: f64): f64

The larger of two f64s as IEEE 754-2019 maximum: NaN if either is NaN, and 0.0 above -0.0.

fclamp (fun)

fun fclamp(value: f64, minimum: f64, maximum: f64): f64

value held to [minimum, maximum] (maximum wins if they cross), with fmin's and fmax's rules: NaN if any argument is NaN, and -0.0 below 0.0.

fma (fun)

fun fma(x: f64, y: f64, z: f64): f64

x * y + z rounded once (IEEE 754 fusedMultiplyAdd): the hardware's instruction where the target has one, an exact software routine elsewhere, so every target gives the same bits.

__mathFmaSoftware (fun)

fun __mathFmaSoftware(x: f64, y: f64, z: f64): f64

x y + z rounded once (IEEE 754 fusedMultiplyAdd), in integers: abla/math's fma where the target has no fused multiply-add instruction, and at compile time. The exact sum is formed in 128 bits with a sticky bit, then rounded once to the nearest double (to even on a tie).

lerp (fun)

fun lerp(from: f64, to: f64, t: f64): f64

Returns from + (to - from) * t. The fraction t can lie outside [0, 1] for extrapolation.

__mathF32 (fun)

fun __mathF32(value: f32): f64

Returns the input widened to f64 with every finite f32 value represented exactly.

__mathToF32 (fun)

fun __mathToF32(value: f64): f32

Returns the nearest f32 with ties to even and signed infinity on overflow.

sqrt (fun)

fun sqrt(value: f32): f32

Returns the square root of value. Negative inputs produce NaN, and negative zero is preserved.

floor (fun)

fun floor(value: f32): f32

Rounds value down to a whole number in the same float type.

ceil (fun)

fun ceil(value: f32): f32

Rounds value up to a whole number in the same float type.

trunc (fun)

fun trunc(value: f32): f32

Rounds value toward zero to a whole number in the same float type.

fabs (fun)

fun fabs(value: f32): f32

Returns value with its sign bit cleared.

roundEven (fun)

fun roundEven(value: f32): f32

Rounds value to a whole f32, choosing the even result at a halfway point.

isNaN (fun)

fun isNaN(value: f32): bool

Returns true when value is NaN.

isFinite (fun)

fun isFinite(value: f32): bool

Returns true for finite value, including either signed zero.

fmin (fun)

fun fmin(left: f32, right: f32): f32

Returns the smaller of left and right, ordering negative zero below positive zero. A NaN operand produces NaN.

fmax (fun)

fun fmax(left: f32, right: f32): f32

Returns the larger of left and right, ordering positive zero above negative zero. A NaN operand produces NaN.

fclamp (fun)

fun fclamp(value: f32, minimum: f32, maximum: f32): f32

Clamps value between minimum and maximum. Reversed bounds yield maximum, and any NaN argument yields NaN.

fma (fun)

fun fma(x: f32, y: f32, z: f32): f32

Computes fused x * y + z in f64, then narrows to f32. The two rounding steps can affect the last bit.

lerp (fun)

fun lerp(from: f32, to: f32, t: f32): f32

Returns from + (to - from) * t. The fraction t can lie outside [0, 1] for extrapolation.

atan2 (fun)

fun atan2(y: f32, x: f32): f32

Returns the direction of (x, y) in radians from the positive x-axis, narrowed from f64.

hypot (fun)

fun hypot(x: f32, y: f32): f32

Returns the length of (x, y), computed in f64 and narrowed to f32.

exp (fun)

fun exp(value: f32): f32

Returns e raised to value, computed in f64 and narrowed to f32. Large positive inputs can overflow to infinity.

log (fun)

fun log(value: f32): f32

Returns the natural logarithm of value, narrowed from f64. Zero yields negative infinity and negative inputs yield NaN.

atan (fun)

fun atan(value: f32): f32

Returns the arctangent of value in radians, narrowed from f64.

sin (fun)

fun sin(value: f32): f32

Returns the sine of value radians, narrowed from f64. Infinite inputs yield NaN.

cos (fun)

fun cos(value: f32): f32

Returns the cosine of value radians, narrowed from f64. Infinite inputs yield NaN.

tan (fun)

fun tan(value: f32): f32

Returns the tangent of value radians, narrowed from f64. Infinite inputs yield NaN.

pow (fun)

fun pow(x: f32, y: f32): f32

Raises x to y in f64 and narrows the result to f32. A finite negative base with a finite noninteger exponent yields NaN.

atan2 (fun)

fun atan2(y: f64, x: f64): f64

The angle of the vector (x, y) from the +x axis, in [-pi, pi], correctly rounded.

mathE (val)

val mathE: f64

e

mathLn2 (val)

val mathLn2: f64

ln 2

__mathHuge (val)

val __mathHuge: f64

1e300 and 2^-1000, whose squares overflow and underflow

__mathTwoM1000 (val)

val __mathTwoM1000: f64

The exact f64 value 2^-1000, whose square underflows to zero.

__mathMulLow (fun)

@inline
fun __mathMulLow(a: f64, b: f64, p: f64): f64

The rounding error of p = a b: a b - p exactly (Dekker's product, for

a,b< 2^995 and no underflow).

__mathMulAdd (fun)

@inline
fun __mathMulAdd(a: f64, b: f64, c: f64): f64

a b + c, rounded once where the target fuses multiply-adds, else twice.

__mathLogReduce (fun)

@inline
fun __mathLogReduce(r: f64, t: f64): f64

r t - 1 rounded once, for an r of at most 9 significant bits: t is split so that both products are exact (one fused multiply-add where there is one).

__mathSquareLow (fun)

@inline
fun __mathSquareLow(a: f64, p: f64): f64

The rounding error of p = a a: a a - p exactly (as __mathMulLow).

__mathMulHigh (fun)

@inline
fun __mathMulHigh(a: int, b: int): int

The high 64 bits of the unsigned 128-bit product a * b, from 32-bit halves with the carries out of the low word counted. (LLVM fuses the textbook form, which sums the middle terms first, into a 128-bit multiplication that wasm32 has only as a library call; this form it leaves alone.)

hypot (fun)

fun hypot(x: f64, y: f64): f64

sqrt(x^2 + y^2) correctly rounded, without overflow or underflow in between; ±inf in either argument gives inf even when the other is NaN.

__mathHypotSubnormal (fun)

@noinline
fun __mathHypotSubnormal(a: int, b: int): f64

hypot of two subnormals from their encodings a >= b > 0: the root of a^2 + b^2 found and rounded in integers.

__mathHypotHard (fun)

@noinline
fun __mathHypotHard(x: f64, y: f64): f64

hypot of x in [1, 2) and y <= x close to a rounding boundary: Newton's root refined and rounded by comparing exact squares in integers.

exp (fun)

fun exp(value: f64): f64

e raised to x, correctly rounded.

__mathExpAccurate (fun)

@noinline
fun __mathExpAccurate(x: f64): f64

exp(x) for 2^-54 < |x| < 745 to about 2^-110, rounded: the path for results the fast path can't round with certainty.

__mathExpException (fun)

@noinline
fun __mathExpException(x: f64, f: f64): f64

The listed exceptional value for x, or f when x isn't listed.

log (fun)

fun log(value: f64): f64

The natural logarithm of x, correctly rounded: -inf at ±0, NaN below.

__mathLogAccurate (fun)

@noinline
fun __mathLogAccurate(x: f64, l1: f64, l2: f64): f64

log(x) for a positive x != 1 to about 2^-124, rounded: log_1's reduction, log(1 + z) by its Taylor series and the table's -log r to 2^-151, with the out-of-line dint operations (l1 and l2 of -log r as the fast path read them).

atan (fun)

fun atan(value: f64): f64

The arctangent of x in [-pi/2, pi/2], correctly rounded.

__mathAtanRefine (fun)

@noinline
fun __mathAtanRefine(x: f64, a: f64): f64

atan(x) for 2^-27 <= |x| to about 2^-118, rounded; a is the fast path's estimate.

sin (fun)

fun sin(x: f64): f64

The sine of x (radians), correctly rounded for every finite x.

cos (fun)

fun cos(x: f64): f64

The cosine of x (radians), correctly rounded for every finite x.

__mathSinCos (fun)

fun __mathSinCos(x: f64, quarter: int): f64

sin(x) for quarter 0, cos(x) = sin(|x| + pi/2) for quarter 1: a port of CORE-MATH's sin.c (copyright 2022-2026 Paul Zimmermann, Tom Hubrecht and Alexei Sibidanov, MIT licence: see the end of this file). Its reduction measures x in turns, so cos is the same computation a quarter turn on, exactly.

__mathSinCosReduce (fun)

@noinline
fun __mathSinCosReduce(x: f64, part: int): f64

For |x| >= 2^31: x / (2 pi) mod 1 = j / 2^15 + r + s with 0 <= r < 2^-15, 0 <= s < 2^-67.988 (CORE-MATH's reduce_large): r for part 0, j for part 1.

__mathSinSmall (fun)

@noinline
fun __mathSinSmall(x: f64): f64

sin(x) for 2^-26 <= |x| < 2^-16 to 2^-112.7 relative, rounded.

__mathMhUU (fun)

@noinline
fun __mathMhUU(ah: int, al: int, bh: int, bl: int, part: int): int

The high 128 bits of the 256-bit product (ah, al) (bh, bl), less the low halves' product: word part (0 high, 1 low) of CORE-MATH's mhUU.

__mathSinCosAccurate (fun)

@noinline
fun __mathSinCosAccurate(x: f64, quarter: int): f64

sin(x) (quarter 0) or cos(x) (quarter 1) for |x| >= 2^-16, |x| >= 2^-27 for cos, by 128-bit fixed point: 2^-128 absolute.

tan (fun)

fun tan(x: f64): f64

The tangent of x (radians), correctly rounded for every finite x.

__mathTanReduceLarge (fun)

@noinline
fun __mathTanReduceLarge(xb: int, part: int): f64

The fast path's reduction for |x| > 2 pi (tan.c's): x / (2 pi) mod 1 as h + l, h for part 0 and l for part 1.

__mathTanAccurate (fun)

@noinline
fun __mathTanAccurate(x: f64): f64

tan's accurate path: tan.c's 128-bit reduction of x, then sin and cos of the reduced angle by their Taylor series and the quotient, all with the out-of-line dint operations (slow, but rarely needed, and without tables).

__mathTanDintToDouble (fun)

fun __mathTanDintToDouble(hi0: int, lo0: int, p: int): f64

A dint rounded to the nearest double (tan.c's dint_tod).

pow (fun)

fun pow(x: f64, y: f64): f64

x raised to y, correctly rounded, with IEEE 754's special cases: pow(x, ±0) and pow(1, y) are 1 even for a NaN, pow(-1, ±inf) is 1, a negative x needs an integer y (NaN otherwise).

__mathIsInt (fun)

@inline
fun __mathIsInt(x: f64): bool

x is an integer (x finite).

__mathPowAccurate (fun)

@noinline
fun __mathPowAccurate(x: f64, y: f64, s: f64, x0: f64, logHigh: f64, logLow: f64): f64

pow's second phase for x > 0 (s the result's sign, x0 the original x): log(x) as log's accurate path computes it, y log(x), then exp in 128 bits (2^(k/64) from exp's table with a third part, and the Taylor series of the rest), all on the out-of-line operations. The relative error is below 2^-111.7: log's below 2^-122 (with |y log(x)| < 2^10 here), the rest below 2^-123. Only a result near a midpoint goes on to the exact-result check and the third phase.

__mathPowLast (fun)

@noinline
fun __mathPowLast(x: f64, y: f64, sgn: int): f64

pow's third phase for x > 0 near a midpoint and not one: log(x) and exp in 256 bits without tables. log(x) = E log(2) + 2 atanh(s) with s = (m - 1) / (m + 1), |s| < 0.1716 (49 terms); exp(R) = 2^k exp(w / 64)^64 with |w| < 0.35 (24 terms, 6 squarings). The relative error is below 2^-238.8 (y log(x) carries log's 2^-249 times |R| < 2^10). Each operation is a multiply-add a b + c, called for its five words in a loop.

__mathPowToDouble (fun)

fun __mathPowToDouble(hi: int, sticky: bool, p: int): f64

The 128- or 256-bit float (hi, the rest's sticky bit, p) rounded to the nearest double (pow.h's dint_tod and qint_tod).

__mathPow2 (fun)

fun __mathPow2(x: f64, e: int): f64

x * 2^e (pow.h's pow2), for an exact x^y.

__mathPowExact (fun)

@noinline
fun __mathPowExact(x: f64, y: f64, sgn: int): f64

x^y when it fits in 54 bits (an exact or midpoint result), else NaN, for x > 0 (sgn the result's sign): CORE-MATH's exact_pow, with the 2^-F-th root of x taken exactly rather than read off an approximation of x^y.

__mathAtan2Special (fun)

@noinline
fun __mathAtan2Special(y: f64, x: f64): f64

atan2 for a zero, infinite or NaN argument.

__mathTimesIsExact (fun)

fun __mathTimesIsExact(a: f64, b: f64, c: f64): bool

a b == c exactly, for finite nonzero a, b and c.

__mathTintHigh (fun)

fun __mathTintHigh(v: f64): int

The double v as a 192-bit float (tint_fromd): its high word, then its p.

__mathTintP (fun)

fun __mathTintP(v: f64): int

Returns the normalized exponent and packed sign bit of a nonzero finite f64 for tint arithmetic.

__mathAtan2ToDouble (fun)

fun __mathAtan2ToDouble(h: int, m: int, l: int, p: int, exact: bool): f64

The 192-bit float (h, m, l, p) rounded to the nearest double (tint_tod), or truncated when exact (it holds a double already).

__mathAtan2Accurate (fun)

@noinline
fun __mathAtan2Accurate(y: f64, x: f64): f64

atan2 in 192 bits (CORE-MATH's atan2_accurate): z = y / x (or x / y) by div_tint, atan(z) by z P(z) / Q(z), then the quadrant, on the out-of-line 192-bit operations below.

__mathTintMul (fun)

@noinline
fun __mathTintMul(ah: int, am: int, al: int, ap: int, bh: int, bm: int, bl: int, bp: int,
    part: int): int

The 192-bit floats a b (CORE-MATH's mul_tint, below 10 ulps), one word at a time (high, middle, low, ex << 1 | sign).

__mathTintAdd (fun)

@noinline
fun __mathTintAdd(ah: int, am: int, al: int, ap: int, bh: int, bm: int, bl: int, bp: int,
    part: int): int

The 192-bit floats a + b (CORE-MATH's add_tint, below 2 ulps, exact when Sterbenz applies), one word at a time (high, middle, low, ex << 1 | sign).

__mathClz (fun)

fun __mathClz(x: int): int

The number of leading zero bits of a 64-bit word.

__mathULess (fun)

@inline
fun __mathULess(a: int, b: int): bool

Returns whether the 64-bit pattern of a is less than b when both are interpreted as unsigned.

__mathShl128High (fun)

fun __mathShl128High(hi: int, lo: int, n: int): int

The 128-bit (hi, lo) shifted left by n >= 0: the high word, then the low word.

__mathShl128Low (fun)

fun __mathShl128Low(lo: int, n: int): int

Returns the low word of a 128-bit left shift by a nonnegative count, or zero when at least 64 bits are shifted.

__mathShr128High (fun)

fun __mathShr128High(hi: int, n: int): int

The 128-bit (hi, lo) shifted right by n >= 0 (logically): high word, low word.

__mathShr128Low (fun)

fun __mathShr128Low(hi: int, lo: int, n: int): int

Returns the low word of a logical 128-bit right shift by a nonnegative count, or zero when at least 128 bits are shifted.

__mathPart (fun)

@inline
fun __mathPart(part: int, hi: int, lo: int, ex: int, sgn: int): int

Returns the high word for part zero, the low word for part one, or the packed exponent and sign for other indices.

__mathDintFrom (fun)

fun __mathDintFrom(x: f64, part: int): int

The double x as a dint.

__mathDintCompare (fun)

fun __mathDintCompare(ah: int, al: int, aex: int, bh: int, bl: int, bex: int): int

a's magnitude compared with b's: -1, 0 or 1.

__mathDintAdd (fun)

@noinline
fun __mathDintAdd(ah: int, al: int, ap: int, bh: int, bl: int, bp: int, part: int): int

Adds two dint values and returns the selected word of the normalized result.

__mathDintMul (fun)

@noinline
fun __mathDintMul(ah: int, al: int, ap: int, bh: int, bl: int, bp: int, part: int): int

a b with 126 bits of accuracy.

__mathDintMulInt (fun)

@noinline
fun __mathDintMulInt(b: int, ah: int, al: int, ap: int, part: int): int

b a for a small integer b.

__mathDintToDouble (fun)

fun __mathDintToDouble(hi: int, p: int): f64

A normal-range dint rounded to the nearest double; the bits after the rounding bit are never all zero for the results this is used for.

__mathExpT0High (fun)

@inline
fun __mathExpT0High(index: int): int

exp: 2^(i/2^6) as double-doubles, high parts (CORE-MATH exp.c t0)

__mathExpT0Low (fun)

@inline
fun __mathExpT0Low(index: int): int

exp: low parts of the above

__mathExpT1High (fun)

@inline
fun __mathExpT1High(index: int): int

exp: 2^(i/2^12) as double-doubles, high parts (CORE-MATH exp.c t1)

__mathExpT1Low (fun)

@inline
fun __mathExpT1Low(index: int): int

exp: low parts of the above

__mathExpExceptions (fun)

fun __mathExpExceptions(index: int): int

exp: exceptional cases, (x, high, low) triples sorted by x (CORE-MATH exp.c db)

__mathExpPoly (fun)

fun __mathExpPoly(index: int): int

exp's accurate polynomial: (high, low) coefficients of degrees 1 to 7

__mathLogInverseLogThird (fun)

@inline
fun __mathLogInverseLogThird(index: int): int

log's accurate path: -log r - l1 - l2 for the r of __mathLogInverse, rounded

__mathLogTaylor (fun)

fun __mathLogTaylor(index: int): int

log's accurate path: (-1)^(k+1) / k for k = 1 to 17, as dints [hi, lo, ex << 1 | sign]

__mathAtanTan (fun)

@inline
fun __mathAtanTan(index: int): int

atan: tan(pi j / 256) for j = 0 to 128 (0 for j = 128) (CORE-MATH atan.c A, first column)

__mathAtanTanError (fun)

@inline
fun __mathAtanTanError(index: int): int

atan: atan of the above minus pi j / 256 (CORE-MATH atan.c A, second column)

__mathAtanIndex (fun)

@inline
fun __mathAtanIndex(index: int): int

atan: a piecewise quadratic estimate of j, (c0, c1, c2) for each of 31 ranges (CORE-MATH atan.c c)

__mathAtanExceptions (fun)

fun __mathAtanExceptions(index: int): int

atan: the refinement's exceptional cases, (|x|, high, low) triples (CORE-MATH atan.c db)

__mathSinInvTwoPi (fun)

fun __mathSinInvTwoPi(index: int): int

sin/cos: 1/(2 pi) in 64-bit words, T[i] weighing 2^(-64 i) (CORE-MATH sin.c _T)

__mathSinU1SinHigh (fun)

@inline
fun __mathSinU1SinHigh(index: int): int

sin/cos: sin(j pi / 2^7) as double-doubles, high parts (CORE-MATH sin.c U1)

__mathSinU1SinLow (fun)

@inline
fun __mathSinU1SinLow(index: int): int

sin/cos: low parts of the above

__mathSinU1CosHigh (fun)

@inline
fun __mathSinU1CosHigh(index: int): int

sin/cos: cos(j pi / 2^7) as double-doubles, high parts (CORE-MATH sin.c U1)

__mathSinU1CosLow (fun)

@inline
fun __mathSinU1CosLow(index: int): int

sin/cos: low parts of the above

__mathSinU2SinHigh (fun)

@inline
fun __mathSinU2SinHigh(index: int): int

sin/cos: sin(j pi / 2^14) as double-doubles, high parts (CORE-MATH sin.c U2)

__mathSinU2SinLow (fun)

@inline
fun __mathSinU2SinLow(index: int): int

sin/cos: low parts of the above

__mathSinU2CosHigh (fun)

@inline
fun __mathSinU2CosHigh(index: int): int

sin/cos: cos(j pi / 2^14) as double-doubles, high parts (CORE-MATH sin.c U2)

__mathSinU2CosLow (fun)

@inline
fun __mathSinU2CosLow(index: int): int

sin/cos: low parts of the above

__mathSinS1 (fun)

fun __mathSinS1(index: int): int

sin/cos's accurate path: sin(pi i / 2^6) for i = 0 to 32 as 128-bit fixed point, (high, low) words (CORE-MATH sin.c S1u)

__mathSinS2 (fun)

fun __mathSinS2(index: int): int

sin/cos's accurate path: sin(pi i / 2^12) for i = 0 to 63 as 128-bit fixed point, (high, low) words (CORE-MATH sin.c S2u)

__mathSinC2 (fun)

fun __mathSinC2(index: int): int

sin/cos's accurate path: cos(pi i / 2^12) for i = 0 to 63 as 128-bit fixed point, (high, low) words (CORE-MATH sin.c C2u)

__mathLimb (fun)

fun __mathLimb(a3: int, a2: int, a1: int, a0: int, j: int): int

Limb j (0 lowest) of the 256-bit (a3, a2, a1, a0); 0 outside.

__mathShr256 (fun)

fun __mathShr256(a3: int, a2: int, a1: int, a0: int, k: int, i: int): int

Limb i of (a3, a2, a1, a0) shifted right by k >= 0 (logically).

__mathShl256 (fun)

fun __mathShl256(a3: int, a2: int, a1: int, a0: int, k: int, i: int): int

Limb i of (a3, a2, a1, a0) shifted left by k >= 0.

__mathClz256 (fun)

fun __mathClz256(a3: int, a2: int, a1: int, a0: int): int

Counts leading zero bits in the four words of a 256-bit value, returning 256 for zero.

__mathQintCompare (fun)

fun __mathQintCompare(a3: int, a2: int, a1: int, a0: int, ap: int, b3: int, b2: int, b1: int,
    b0: int, bp: int): int
acompared withbfor 256-bit floats: -1, 0 or 1 (cmp_qint).

__mathCtz (fun)

fun __mathCtz(x: int): int

The number of trailing zero bits of a nonzero word.

__mathExpT0Third (fun)

@inline
fun __mathExpT0Third(index: int): int

pow's second phase: 2^(i/2^6) - high - low for exp's table, rounded, so that the three parts give 2^(i/2^6) to about 2^-158

__mathQintMulAdd (fun)

@noinline
fun __mathQintMulAdd(a3: int, a2: int, a1: int, a0: int, ap: int, b3: int, b2: int, b1: int,
    b0: int, bp: int, c3: int, c2: int, c1: int, c0: int, cp: int, part: int): int

a b + c for 256-bit floats (CORE-MATH's qint: value = w3 / 2^63 2^ex, the words high first, p = ex << 1 | sign), one word at a time: the product exact to its top 320 bits, then truncated, then the sum truncated (each below 2 ulps; a zero factor gives c, a zero c the product).

__mathQintDivInt (fun)

@noinline
fun __mathQintDivInt(a3: int, a2: int, a1: int, a0: int, ap: int, n: int, part: int): int

The 256-bit float a divided by the integer 0 < n < 2^31 (below 2 ulps), one word at a time: a long division in 32-bit digits, then normalized.

__mathQintPart (fun)

@inline
fun __mathQintPart(part: int, a3: int, a2: int, a1: int, a0: int, p: int): int

Returns significand word zero through three in high-to-low order, or the packed exponent and sign for any other index.

__mathLogInverse (fun)

@inline
fun __mathLogInverse(index: int): int

log and pow: 9-bit approximations r of 1/x on [i/2^8, (i+1)/2^8), i from 181 (CORE-MATH pow.h _INVERSE)

__mathLogInverseLogHigh (fun)

@inline
fun __mathLogInverseLogHigh(index: int): int

log and pow: -log(r) as double-doubles, high parts (multiples of 2^-42) (CORE-MATH pow.h _LOG_INV)

__mathLogInverseLogLow (fun)

@inline
fun __mathLogInverseLogLow(index: int): int

pow: low parts of the above

__mathAtan2P (fun)

fun __mathAtan2P(index: int): int

atan2's accurate path: z P(z) / Q(z) approximates atan(z) on [0, 1]; P's coefficients in 192 bits, [h, m, l, ex << 1 | sign] each, degree 0 first

__mathAtan2Q (fun)

fun __mathAtan2Q(index: int): int

Q's coefficients, likewise

__mathAtan2High (fun)

fun __mathAtan2High(index: int): int

atan(i / 64) rounded to 53 bits, for 0 <= i <= 64

__mathAtan2Low (fun)

fun __mathAtan2Low(index: int): int

the rounding error of __mathAtan2High(i)

__mathTanTaylor (fun)

fun __mathTanTaylor(index: int): int

tan's accurate path: the Taylor coefficients (-1)^n / (2n+1)! of sin (0 to 16) then (-1)^n / (2n)! of cos, as dints [hi, lo, ex << 1 | sign]

Built from Abla v0.2.79 source ba5d6b7d. Examples and generated signatures follow that source revision.