FN-GAMMA-002: From 10 up, GAMMA is a Stirling product of stored stages, and its error grows with x
Excel differs from the mathematical answer · inferred · recorded 2026-11-04
From x = 10, GAMMA behaves as sqrt(2 pi) x^x exp(-x) / sqrt(x) w with stored stages: x^2, x^4, x^8 and so on by binary powering of floor(x/2), stored ln x, exponent and exponential for the fraction of x/2, stored exp(-x), an unstored square root, and each outer product stored. The first factor is the binary64 value of sqrt(2 pi), whose rounding gives every band a bias of +0.66 of 2^-53. The answers' noise grows with x, with a root mean square of about 0.225*x units of 2^-53 above 20, so near x = 160 an answer can sit 89 units from the correctly rounded value, as below.
| Call and input route | Inputs | Excel | Correct value | Recorded in |
|---|---|---|---|---|
GAMMA(10.649360706449173)cell-value2 | number: 10.6493607064491730x40254c7901ab0368 | 1600316.67082694360x41386b3cabbb5088 | 1600316.67082694380x41386b3cabbb5089 | Excel 16.0 build 20527, Windows; bitness and CPU not recorded in this reading |
GAMMA(160.48267465838674)cell-value2 | number: 160.482674658386740x40640f7212200c21 | 3.410909690032054e+2830x7acd5c4d6f1f4edc | 3.4109096900320908e+2830x7acd5c4d6f1f4f35 | Excel 16.0 build 20527, Windows; bitness and CPU not recorded in this reading |
Correct value: mpmath gamma at 800 bits from the binary64 input, correctly rounded.
Correct value: mpmath gamma at 800 bits from the binary64 input, correctly rounded.
Basis: Noise lines on windows of consecutive doubles (Excel build 20527): stored x^2 with weight x/2, then x^4, x^8 and x^16 at the frequencies a stored square of a stored value gives, stored ln x, and the bias. This chain gives every bit on 69.5% of 59,200 answers from 36 to 170.
Inferred: The chain is read from the noise, and 30.5% of the answers in that range do not yet match, so at least one stored stage is missing. The series w is only seen as a line at 1/(12 m x), and below x = 30 it differs from the true series.
Open: The Stirling series below x = 30, and the stored stage still missing above it.
Evidence and capture sources
- ExcelFunctionsHandbook · content/notes/evidence/2026-11-04/gamma-EVIDENCE.md b5d84a80a5a4640eca9ce04f232c0bc115503f34 · research write-up: how the stored stages were read
- DnaCalc · crates/calc-func/src/ported/excel_numeric/gammaln.rs 1c7a4ab86b12b53d80947f06b6d381e8e5dd5f3f · the routes in the product, with stand-ins where the code says so; the commit message carries the row counts
- DnaCalc · crates/calc-func/witness-status.tsv af74247e1ed54f0b535143f1305261b98d80d18e · rows matched per function
- ExcelFunctionsHandbook · content/notes/evidence/2026-11-04/gamma-readings.tsv b5d84a80a5a4640eca9ce04f232c0bc115503f34 · GAMMA 40254c7901ab0368
- ExcelFunctionsHandbook · content/notes/evidence/2026-11-04/gamma-readings.tsv b5d84a80a5a4640eca9ce04f232c0bc115503f34 · GAMMA 40640f7212200c21