code wiki / _hdl_build / nx_mathspec_erf.nx
nx_mathspec_erf.nx
buildroot/runtime/_hdl_build/nx_mathspec_erf.nx
about
nx_mathspec_erf.nx -- SOVEREIGN SPEC EMITTER for the ERF kernel (DLMF ch7 rung 1,
ME2-ERF-001). Every constant from the 120-bit bigfloat -- no python, no minimax:
2/sqrt(pi) via bf_pi (Machin) + NEWTON square root (8 iterations from the f64
seed, doubling precision each step: bf_div exists, so s <- (s + pi/s)/2);
Taylor reciprocals r_n = 1/(n!(2n+1)) by factor-by-factor bf_div_small with
the sign (-1)^n BAKED into the emitted bits (the sinhcosh P_k sign gene).
REFUSAL RAILS (refuse > fabricate):
R1: (2/sqrt(pi)) * sqrt(pi) must equal 2 to ~100 bits, else exit 2 no emit;
R2: the derived 2/sqrt(pi) f64 bits must equal the KNOWN-GOOD libm constant
0x3FF20DD750429B6D bit-exactly (derive sovereignly, verify vs the world).
Layout: c[0]=one c[1]=two_over_sqrt_pi c[2]=tosp_hi(32-bit split) c[3]=tosp_lo
c[4..35]=32 SIGNED Taylor reciprocals hi-first: (-1)^n/(n!(2n+1)) n=31..0
(24 terms left the tail at ~2^-42 at the cut; 32 puts it past 2^-67 -- ULP-clean)
c[36]=series_cut 1.75 c[37]=one_cut 6.0 (|x|>=6 -> erf=+-1 sub-ulp)
Emits runtime/_hdl_build/_pm_erf_spec.nx :: pm_erf_spec_fill(c)->30
license_tier: ORIGINAL
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_pattern_emit.nxnx_bigfloat120.nxnx_bigfloat120_div.nxnx_bigfloat120_trig.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 23 | func mse_wlit(fd: i64, v: i64) -> i64 |
| 33 | func mse_emit_row(fd: i64, idx: i64, v: i64) -> i64 |
| 41 | func mse_recip(out: *i64, n: i64) -> i64 |
| 57 | func mse_sqrt(out: *i64, a: *i64, seed_raw: i64) -> i64 |
| 72 | func main() -> i64 |