code wiki / _hdl_build / _bf_gamma_gate_authored.nx

_bf_gamma_gate_authored.nx

buildroot/runtime/_hdl_build/_bf_gamma_gate_authored.nx

8338 B194 linesdepth 8pulls 11 transitivereach 0 importersview sourcekind tooltopic bf
docsdependenciesstructsconstsfunctions

about

_bf_gamma_gate_authored.nx -- self-anchor gate for the SOVEREIGN bigfloat gamma oracle (nx_bigfloat120_gamma). No external oracle: 1. EXACT FACTORIALS: Gamma(n) = (n-1)! for n = 2..19 ((n-1)! <= 18! fits bf_set_int's 2^53 bound), rel < 2^-100 -- Stirling + shifts must land on exact integers across 18 different shift depths. 2. RECURRENCE: Gamma(x+1) = x Gamma(x) at 100 banded non-integer points (x in ~(0.5, 56)): adjacent shift depths must agree, rel < 2^-100. 3. GAMMA(1/2)^2 = pi (squares the result; no sqrt needed), rel < 2^-100. 4. REFLECTION PRODUCT: G(x) G(1-x) sin(pi x) = pi on (0,1) at 40 points (proves the negative-axis path's organs), rel < 2^-95. 5. C99 specials: +-0 -> +-inf, neg integers/-inf -> NaN, +inf -> +inf, 172 -> inf, 171.5 finite, Gamma(1)=Gamma(2)=1 exactly, Gamma(-0.5) vs -2*Gamma(0.5) within 2 ulp, deep-negative signed zeros by parity. Markers: BFGAM-FACT / BFGAM-RECUR / BFGAM-HALF / BFGAM-REFL / BFGAM-SPEC

dependencies 10 imports · 0 importers

nx_syscalls.nx nx_f64.nx nx_f64_div.nx nx_bigfloat120.nx nx_bigfloat120_div.nx nx_bigfloat120_trig.nx nx_bigfloat120_exp.nx nx_bigfloat120_ln.nx nx_bigfloat120_pow.nx nx_bigfloat120_gamma.nx _bf_gamma_gate_authored.nx

imports: nx_syscalls.nxnx_f64.nxnx_f64_div.nxnx_bigfloat120.nxnx_bigfloat120_div.nxnx_bigfloat120_trig.nxnx_bigfloat120_exp.nxnx_bigfloat120_ln.nxnx_bigfloat120_pow.nxnx_bigfloat120_gamma.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_set_int sys_mmap ↻ bfg_gamma_pos bf_new ↻ bf_set_int ↻ bf_copy bf_cmp bf_is_zero bf_mul bf_is_zero ↻ bf_copy ↻ sys_mmap ↻ bf_add bf_is_zero ↻ bf_copy ↻ sys_mmap ↻ bf_shr2 bf_norm bfg_lngamma_big bf_new ↻ bf_set_int ↻ bf_copy ↻ bf_sub bf_is_zero ↻ bf_copy ↻ sys_mmap ↻ bf_shr2 ↻ bf_norm ↻ bfg_ln_big bf_new ↻ bf_copy ↻ bf_set_int ↻ bf_cmp ↻ bf_sub ↻ bf_add ↻ bf_div bf_is_zero ↻

structs

none

consts

none

functions

27func bgg_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
28func bgg_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
29func bgg_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 }
called by 1: main calls 2: sys_mmapsys_write
31func bgg_rng(state: *i64) -> i64
called by 1: main
40func bgg_relok(a: *i64, b: *i64, bits: i64) -> i64
called by 1: main calls 4: bf_newbf_cmpbf_subbf_is_zero
48func bgg_ord(v: i64) -> i64
called by 1: bgg_ulp
53func bgg_ulp(a: i64, b: i64) -> i64
called by 1: main calls 1: bgg_ord
60func main() -> i64