Expand description
Deterministic math functions for cross-platform WASM reproducibility.
Provides det_sin, det_cos, det_sincos, det_atan2, det_hypot,
det_exp, and det_powi_f64 using only IEEE 754 operations that map
to WASM intrinsics (add, sub, mul, div, floor, sqrt, abs, copysign,
bit-pattern manipulation). No calls to Math.sin, Math.cos,
Math.exp, etc.
Algorithms and coefficients are classical polynomial approximations of
IEEE 754 transcendentals (Cody-Waite range reduction + minimax
polynomials evaluated by Horner’s scheme), guaranteeing < 1 ULP error
for all functions. det_powi_f64 is exponentiation-by-squaring on
bit-exact IEEE 754 multiply — exact by construction.
Functions§
- det_
atan2 - Deterministic atan2(y, x) — uses only WASM-intrinsic f64 operations.
- det_cos
- Deterministic cosine — uses only WASM-intrinsic f64 operations.
- det_exp
- Deterministic exp(x) — classical exp polynomial with Cody-Waite ln(2) range reduction.
- det_
hypot - Deterministic hypot(x, y) = sqrt(x² + y²).
- det_
powi_ f64 - Deterministic integer-exponent power:
base^nforn: i32. - det_sin
- Deterministic sine — uses only WASM-intrinsic f64 operations.
- det_
sincos - Deterministic sin and cos computed together (shared range reduction).