code wiki / (root) / nx_f64_exp.nx

nx_f64_exp.nx

buildroot/runtime/nx_f64_exp.nx

3296 B78 linesdepth 4pulls 5 transitivereach 13 importersview sourcekind librarytopic f64
docsdependenciesstructsconstsfunctions

about

nx_f64_exp.nx -- binary64 exponential, bits-up (ME1 rung 1, DLMF ch.4). THE TEMPLATE for the ME1 transcendental family (and the future Builder MATH_KERNEL pattern emitter): range-reduce -> polynomial -> rescale, with every constant GENERATED from a high-precision runtime oracle (_f64_exp_consts.nx, mpmath @60dps) and a ULP-bounded KAT gate (_f64_exp_gate_authored, vectors correctly rounded by the same oracle). Algorithm (Cody & Waite 1980 range reduction; Hart 1968 poly approach): 1. specials: NaN->NaN, +inf->+inf, -inf->0, +-0->1; |x| beyond the over/underflow cutoffs short-circuits to inf / 0. 2. k = nearest-int(x / ln2) (trunc of x*INV_LN2 +- 0.5) 3. r = (x - k*LN2_HI) - k*LN2_LO -- k*LN2_HI exact (25-bit hi split, |k| <= 1075 = 11 bits), so r carries ~full f64 precision; |r| <= ln2/2. 4. exp(r) = Horner sum of r^i/i!, i = 0..15 (truncation < 1e-21 rel, far below half-ulp; observed error is rounding accumulation only). 5. result = ldexp(exp(r), k) -- correct gradual underflow via round_pack. ULP bound: GATED, not asserted -- see math_engine.log EXP-ULP line. One transcendental per file (family law; see nx_f32_div.nx quirk note). license_tier: ORIGINAL

dependencies 5 imports · 7 importers

nx_syscalls.nx nx_tier.nx nx_f64.nx nx_f64_cvt.nx _f64_exp_consts.nx nx_f64_exp.nx _f64_exp_gate_authored.nx _f64_igammaq_gate.nx _pe_f64erfc.nx _pe_f64igammaq.nx nx_bd_calc.nx nx_f64_quad.nx nx_f64_rootfind.nx

imports: nx_syscalls.nxnx_tier.nxnx_f64.nxnx_f64_cvt.nx_f64_exp_consts.nx

imported by: _f64_exp_gate_authored.nx_f64_igammaq_gate.nx_pe_f64erfc.nx_pe_f64igammaq.nxnx_bd_calc.nxnx_f64_quad.nxnx_f64_rootfind.nx

structs

none

consts

none

functions

30func nx_f64_exp(x: i64) -> i64