code wiki / _hdl_build / nx_mathspec_pow.nx

nx_mathspec_pow.nx

buildroot/runtime/_hdl_build/nx_mathspec_pow.nx

7176 B214 linesdepth 5pulls 6 transitivereach 0 importersview sourcekind tooltopic mathspec
docsdependenciesstructsconstsfunctions

about

nx_mathspec_pow.nx -- SOVEREIGN SPEC EMITTER for the POW kernel: every constant computed on the 120-bit bigfloat; written to _pm_pow_spec.nx for the MATH_KERNEL/POW emitter. No python, no minimax tables: the kernel's correction polynomials use EXACT-RATIONAL Taylor families L_j = 3/(2j+3) (log2 atanh-correction, |s| <= 0.101 -> 10 terms) P_k = 2*B_{2k}/(2k)! (exp R(z)=z(e^z+1)/(e^z-1) Bernoulli form, 8 terms) where B_2..B_16 = 1/6 -1/30 1/42 -1/30 5/66 -691/2730 7/6 -3617/510 (DLMF 24.2, mathematical definitions like 1/k!). (2k)! division runs as a loop of small divisors 2..2k (bf_div_small bound). The sqrt(3/2)/sqrt(3) anchor cuts come from 53-step bigfloat binary search on sig^2 vs 3*2^103 / 3*2^104. 32-bit hi/lo splits (dp, cp, lg2) mask AFTER rounding; remainder via bf_sub. Layout: c[0]=one c[1]=half c[2]=two c[3]=cut_sqrt15 c[4]=cut_sqrt3 c[5]=bp1 c[6]=dp_h c[7]=dp_l (log2(1.5) split) c[8]=cp_h c[9]=cp_l c[10]=cp(2/(3ln2)) c[11]=lg2 c[12]=lg2_h c[13]=lg2_l c[14..23]=L10..L1 (hi-first) c[24..31]=P8..P1 (hi-first, signed) c[32]=three c[33]=1025.0 c[34]=1076.0 license_tier: ORIGINAL

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_pattern_emit.nx nx_bigfloat120.nx nx_bigfloat120_div.nx nx_bigfloat120_exp.nx nx_mathspec_pow.nx

imports: nx_syscalls.nxnx_pattern_emit.nxnx_bigfloat120.nxnx_bigfloat120_div.nxnx_bigfloat120_exp.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_openat_wr sys_exit pe_w sys_write bf_new sys_mmap bf_set_int mpw_emit_row pe_w ↻ pe_wn sys_mmap ↻ sys_write ↻ mpw_wlit pe_w ↻ pe_wn ↻ bf_to_f64 bf_is_zero bf_copy mpw_sqrt_cut bf_new ↻ bf_set_int ↻ bf_mul bf_is_zero ↻ bf_copy ↻ sys_mmap ↻ bf_cmp bf_is_zero ↻ bf_ln2 bf_new ↻ bf_set_int ↻ bf_div_small bf_is_zero ↻ bf_copy ↻ bf_norm bf_mul ↻ bf_copy ↻ bf_add bf_is_zero ↻ bf_copy ↻

structs

none

consts

23const K_MAGIC_2730: i64 = 2730
24const K_MAGIC_3617: i64 = 3617
25const K_MAGIC_1025: i64 = 1025
26const K_MAGIC_1076: i64 = 1076

functions

28func mpw_wlit(fd: i64, v: i64) -> i64
called by 1: mpw_emit_row calls 2: pe_wpe_wn
38func mpw_emit_row(fd: i64, idx: i64, v: i64) -> i64
47func mpw_emit_split(fd: i64, idxhi: i64, idxlo: i64, v: *i64) -> i64
60func mpw_sqrt_cut(small: i64, eshift: i64) -> i64
called by 1: main calls 4: bf_newbf_set_intbf_mulbf_cmp
78func mpw_log2_15(out: *i64, ln2: *i64) -> i64
107func mpw_pk(out: *i64, bnum: i64, bden: i64, twok: i64) -> i64
121func main() -> i64