code wiki / (root) / nx_bigfloat120_pow.nx

nx_bigfloat120_pow.nx

buildroot/runtime/nx_bigfloat120_pow.nx

8047 B239 linesdepth 6pulls 6 transitivereach 15 importersview sourcekind librarytopic bigfloat120
docsdependenciesstructsconstsfunctions

about

nx_bigfloat120_pow.nx -- SOVEREIGN pow oracle: binary64 pair in, binary64 out, pow(x,y) = exp(y * ln|x|) entirely on the 120-bit bigfloat (sign by the odd-integer-y rule). Margin: |y*ln x| <= 1100 for any finite nonzero result, so the bigfloat's 2^-110 relative error gives the exp argument an ABSOLUTE error < 2^-99 -- the result is correct to ~2^-99 relative, 45 bits past the f64 half-ulp decision boundary. |v| > 1100 is decided as hard inf/zero (the finite-result band ends at |ln r| ~ 745.2); inside the band bf_to_f64 handles overflow -> inf and gradual underflow -> subnormal/zero exactly. The IEEE-754/C99 special matrix is decided in pure bit logic BEFORE any bigfloat runs (pow(x,+-0)=1 and pow(+1,y)=1 even for NaN partners). Self-anchor (see _bf_pow_gate_authored): pow(x,2)=fl(x*x), pow(x,-1)=fl(1/x), pow(x,1/2)=sqrt(x) against the BLESSED f64 mul/div/sqrt organs (correctly- rounded equalities), exact power-of-two ladders incl. the subnormal floor and the overflow ceiling, plus the full special matrix. license_tier: ORIGINAL

dependencies 6 imports · 8 importers

nx_syscalls.nx nx_tier.nx nx_bigfloat120.nx nx_bigfloat120_div.nx nx_bigfloat120_exp.nx nx_bigfloat120_ln.nx nx_bigfloat120_pow.nx _bf_gamma_gate_authored.nx _bf_pow_gate_authored.nx _bf_sinhcosh_gate_authored.nx _f64_pow_gate_authored.nx _f64_sinhcosh_gate_authored.nx _pw_probe.nx nx_bigfloat120_gamma.nx nx_bigfloat120_sinh.nx

imports: nx_syscalls.nxnx_tier.nxnx_bigfloat120.nxnx_bigfloat120_div.nxnx_bigfloat120_exp.nxnx_bigfloat120_ln.nx

imported by: _bf_gamma_gate_authored.nx_bf_pow_gate_authored.nx_bf_sinhcosh_gate_authored.nx_f64_pow_gate_authored.nx_f64_sinhcosh_gate_authored.nx_pw_probe.nxnx_bigfloat120_gamma.nxnx_bigfloat120_sinh.nx

structs

none

consts

25const K_MAGIC_1100: i64 = 1100

functions

28func pw_int_class(y: i64) -> i64
44func bfp_ln_big(out: *i64, ax: i64) -> i64
130func bfp_exp_pm(out: *i64, v: *i64, vsign: i64) -> i64
177func bf_pow_f64(x: i64, y: i64) -> i64