code wiki / _hdl_build / nx_mathspec_erf.nx

nx_mathspec_erf.nx

buildroot/runtime/_hdl_build/nx_mathspec_erf.nx

5723 B150 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tooltopic mathspec
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_pattern_emit.nx nx_bigfloat120.nx nx_bigfloat120_div.nx nx_bigfloat120_trig.nx nx_mathspec_erf.nx

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

main bf_new sys_mmap bf_pi bf_new ↻ bf_atan_inv bf_new ↻ bf_set_int bf_div_small bf_is_zero bf_copy bf_norm bf_mul bf_is_zero ↻ bf_copy ↻ sys_mmap ↻ bf_copy ↻ bf_add bf_is_zero ↻ bf_copy ↻ sys_mmap ↻ bf_shr2 bf_norm ↻ bf_sub bf_is_zero ↻ bf_copy ↻ sys_mmap ↻ bf_shr2 ↻ bf_norm ↻ bf_sub ↻ mse_sqrt bf_new ↻ bf_set_f64 bf_div bf_is_zero ↻ bf_copy ↻ bf_norm ↻ bf_add ↻ bf_div_small ↻ bf_copy ↻

structs

none

consts

none

functions

23func mse_wlit(fd: i64, v: i64) -> i64
called by 1: mse_emit_row calls 2: pe_wpe_wn
33func mse_emit_row(fd: i64, idx: i64, v: i64) -> i64
called by 1: main calls 3: pe_wpe_wnmse_wlit
41func mse_recip(out: *i64, n: i64) -> i64
57func mse_sqrt(out: *i64, a: *i64, seed_raw: i64) -> i64
72func main() -> i64