nx_bigfloat120_gamma.nx
buildroot/runtime/nx_bigfloat120_gamma.nx
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
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
| 30 | const K_MAGIC_2730: i64 = 2730 |
| 31 | const K_MAGIC_3617: i64 = 3617 |
| 32 | const K_MAGIC_43867: i64 = 43867 |
| 33 | const K_MAGIC_174611: i64 = 174611 |
| 34 | const K_MAGIC_854513: i64 = 854513 |
| 35 | const K_MAGIC_236364091: i64 = 236364091 |
| 36 | const K_MAGIC_8553103: i64 = 8553103 |
| 37 | const K_MAGIC_23749461029: i64 = 23749461029 |
| 38 | const K_MAGIC_8615841276005: i64 = 8615841276005 |
| 39 | const K_MAGIC_14322: i64 = 14322 |
| 40 | const K_MAGIC_7709321041217: i64 = 7709321041217 |
| 41 | const K_MAGIC_2577687858367: i64 = 2577687858367 |
| 42 | const K_MAGIC_2047: i64 = 2047 |
functions
| 46 | func bfg_ln_big(out: *i64, xb: *i64) -> i64 |
| 92 | func bfg_sin_big(out: *i64, xb: *i64) -> i64 |
| 114 | func bfg_lngamma_big(out: *i64, z: *i64) -> i64 |
| 198 | func bfg_gamma_pos(out: *i64, xb: *i64) -> i64 |
| 229 | func bf_gamma_f64(x: i64) -> i64 called by 8: mainmainmainmainmainmain+2 calls 11: bf_newbf_set_f64bfg_gamma_posbf_to_f64pw_int_classbf_pi+5 |