code wiki / _hdl_build / _bf_pow_gate_authored.nx
_bf_pow_gate_authored.nx
buildroot/runtime/_hdl_build/_bf_pow_gate_authored.nx
about
_bf_pow_gate_authored.nx -- self-anchor gate for the SOVEREIGN bigfloat pow
oracle (nx_bigfloat120_pow). No external oracle:
1. CORRECTLY-ROUNDED EQUALITIES vs three BLESSED f64 organs at 200 banded
random points: pow(x,2) == fl(x*x) (nx_f64_mul), pow(x,-1) == fl(1/x)
(nx_f64_div), pow(x,1/2) == sqrt(x) (nx_f64_sqrt), pow(x,1) == x.
Both sides round the same true value -> raws must be IDENTICAL.
2. EXACT POWER LADDER: pow(2,n) across the whole format incl. the subnormal
floor (n=-1074), the round-to-even-zero tie (n=-1075) and the overflow
ceiling (n=1024); mirrored via pow(1/2,-n).
3. The IEEE-754/C99 special matrix + odd-integer sign rule.
Markers: BFPOW-EQ / BFPOW-LADDER / BFPOW-SPEC / BFPOW-GATE verdict=
dependencies 10 imports · 0 importers
imports: nx_syscalls.nxnx_f64.nxnx_f64_div.nxnx_f64_sqrt.nxnx_f64_cvt.nxnx_bigfloat120.nxnx_bigfloat120_div.nxnx_bigfloat120_exp.nxnx_bigfloat120_ln.nxnx_bigfloat120_pow.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
| 24 | func bpg_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 25 | func bpg_putn(v: i64) -> i64 { let bb: *u8 = sys_mmap(28); var m: i64 = v; if m < 0 { m = 0 - m; sys_write(1, "-" as *u8, 1) }; let t: *u8 = sys_mmap(28); var k: i64 = 0; if m == 0 { t[0] = 48; k = 1 }; while m > 0 { t[k] = 48 + (m % 10); m = m / 10; k = k + 1 }; var i: i64 = 0; while i < k { bb[i] = t[k-1-i]; i = i + 1 }; sys_write(1, bb, k); return 0 } |
| 26 | func bpg_puthex(v: i64) -> i64 { let bb: *u8 = sys_mmap(20); var i: i64 = 0; while i < 16 { let nib: i64 = (v >> ((15 - i) * 4)) & 15; if nib < 10 { bb[i] = 48 + nib } else { bb[i] = 55 + nib } i = i + 1 } sys_write(1, bb, 16); return 0 } |
| 28 | func bpg_rng(state: *i64) -> i64 called by 1: main |
| 37 | func bpg_pow2_expect(n: i64) -> i64 called by 1: main |
| 44 | func main() -> i64 |