code wiki / _hdl_build / _bf_trig_gate_authored.nx

_bf_trig_gate_authored.nx

buildroot/runtime/_hdl_build/_bf_trig_gate_authored.nx

5425 B134 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind tooltopic bf
docsdependenciesstructsconstsfunctions

about

_bf_trig_gate_authored.nx -- gate for the SOVEREIGN trig oracle. All anchors are internal (no python, no external constants): P0 pi by TWO independent formulas agrees to ~2^-117: Machin: pi = 16*atan(1/5) - 4*atan(1/239) Gauss: pi = 48*atan(1/18) + 32*atan(1/57) - 20*atan(1/239) P1 Pythagorean identity in bigfloat at 200 xorshift points (|x| < 2^20): |sin^2(r)+cos^2(r) - 1| < 2^-110 after full reduction P2 f64-level IEEE invariants: sin odd / cos even bit-exact, sin(+-0)=+-0, cos(+-0)=1, NaN/inf -> NaN, |x| >= 2^20 -> NaN (honest v1 refusal) Markers: TRIGP0 ... / TRIGP1 ... / TRIGP2 ... / BF-TRIG-GATE verdict=

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_bigfloat120.nx nx_bigfloat120_div.nx nx_bigfloat120_trig.nx _bf_trig_gate_authored.nx

imports: nx_syscalls.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 ↻ bf_atan_inv ↻ bf_mul_small bf_is_zero ↻ bf_copy ↻ bf_norm ↻ bf_add ↻ bf_sub ↻ bf_cmp bf_is_zero ↻ bf_is_zero ↻

structs

none

consts

none

functions

17func bft_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
18func bft_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 }
called by 1: main calls 2: sys_mmapsys_write
20func bft_rng(state: *i64) -> i64
called by 1: main
29func main() -> i64