code wiki / (root) / nx_bigfloat120_gamma.nx

nx_bigfloat120_gamma.nx

buildroot/runtime/nx_bigfloat120_gamma.nx

10481 B289 linesdepth 7pulls 8 transitivereach 8 importersview sourcekind librarytopic bigfloat120
docsdependenciesstructsconstsfunctions

about

nx_bigfloat120_gamma.nx -- SOVEREIGN gamma oracle on the 120-bit bigfloat (ME2 rung 1: DLMF ch.5 enters the engine). Composition of blessed organs: ln Gamma(z) = (z - 1/2) ln z - z + ln(2 pi)/2 + sum_{n=1..17} B_2n / (2n (2n-1) z^(2n-1)) [z >= 30] with the INTEGER Bernoulli rationals B_2..B_34 (DLMF 24.2 -- mathematical constants like k!; B_36's numerator exceeds i64 and is not needed: at z = 30 the n=17 tail is < 2^-138, 28 bits past the oracle's 2^-110 contract). x < 30 shifts up by the recurrence Gamma(x) = Gamma(x+k)/(x(x+1)..(x+k-1)); negative non-integers reflect through pi/(sin(pi x) Gamma(1-x)) over the blessed trig organ. exp from the pow organ; ln rebuilt bigfloat-in (the atanh form; exponent split is exact). C99 tgamma specials: +-0 -> +-inf, negative integers and -inf -> NaN, +inf -> +inf, x > 172 -> +inf (true overflow 171.624), x < -184 -> +-0 (|Gamma| below the subnormal floor; sign by interval parity). Self-anchor (see _bf_gamma_gate_authored): EXACT factorials to 18!, the recurrence identity across different shift depths, Gamma(1/2)^2 = pi, and the reflection product r(x) r(1-x) sin(pi x) = pi on (0,1). license_tier: ORIGINAL

dependencies 8 imports · 8 importers

nx_syscalls.nx nx_tier.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 _f64_gamma_refl_gate.nx _f64_gamma_refl_neg_gate.nx _gamma_dd_probe.nx _gamma_gate_authored.nx _gamma_probe.nx _gprobe.nx nx_mathspec_gamma.nx

imports: nx_syscalls.nxnx_tier.nxnx_bigfloat120.nxnx_bigfloat120_div.nxnx_bigfloat120_trig.nxnx_bigfloat120_exp.nxnx_bigfloat120_ln.nxnx_bigfloat120_pow.nx

imported by: _bf_gamma_gate_authored.nx_f64_gamma_refl_gate.nx_f64_gamma_refl_neg_gate.nx_gamma_dd_probe.nx_gamma_gate_authored.nx_gamma_probe.nx_gprobe.nxnx_mathspec_gamma.nx

structs

none

consts

30const K_MAGIC_2730: i64 = 2730
31const K_MAGIC_3617: i64 = 3617
32const K_MAGIC_43867: i64 = 43867
33const K_MAGIC_174611: i64 = 174611
34const K_MAGIC_854513: i64 = 854513
35const K_MAGIC_236364091: i64 = 236364091
36const K_MAGIC_8553103: i64 = 8553103
37const K_MAGIC_23749461029: i64 = 23749461029
38const K_MAGIC_8615841276005: i64 = 8615841276005
39const K_MAGIC_14322: i64 = 14322
40const K_MAGIC_7709321041217: i64 = 7709321041217
41const K_MAGIC_2577687858367: i64 = 2577687858367
42const K_MAGIC_2047: i64 = 2047

functions

46func bfg_ln_big(out: *i64, xb: *i64) -> i64
92func bfg_sin_big(out: *i64, xb: *i64) -> i64
114func bfg_lngamma_big(out: *i64, z: *i64) -> i64
198func bfg_gamma_pos(out: *i64, xb: *i64) -> i64
229func bf_gamma_f64(x: i64) -> i64