FN-GAMMALN-001: GAMMALN from 3 to 8 is a stored recurrence, and GAMMALN(3) is one unit above ln 2
Detail for matching Excel's bits · measured · recorded 2026-11-04
With RN(v) meaning v rounded to 64 bits on the x87 unit and then stored to binary64, write x = n + y with n the integer part. For 3 < x < 8, Excel forms z = (y+2)(y+3)...(y+n-1) from the left with every product RN, and GAMMALN(x) is RN(RN(ln z) + GAMMALN(2+y)). So answers on this range carry the rounding of a value on [2,3]. x = 3 itself belongs to the band on [2,3], not to this route, and returns 0x3fe62e42fefa39f0, one unit above the stored ln 2, although GAMMALN(3) is exactly ln 2.
| Call and input route | Inputs | Excel | Correct value | Recorded in |
|---|---|---|---|---|
GAMMALN(3)cell-value2 | x: 30x4008000000000000 | 0.69314718055994540x3fe62e42fefa39f0 | 0.69314718055994530x3fe62e42fefa39ef | Excel 16.0 build 20131, platform and bitness not recorded, AMD Ryzen 7 4800H |
GAMMALN.PRECISE(3)cell-value2 | x: 30x4008000000000000 | 0.69314718055994540x3fe62e42fefa39f0 | 0.69314718055994530x3fe62e42fefa39ef | Excel 16.0 build 20131, platform and bitness not recorded, AMD Ryzen 7 4800H |
GAMMALN(2.020222407046596)cell-value2 | x: 2.0202224070465960x4000296a5d874ad0 | 0.0086810348615622350x3f81c75cc69b54fc | — | Excel 16.0 build 20527, Windows; bitness and CPU not recorded in this reading |
GAMMALN(6.020222407046596)cell-value2 | x: 6.0202224070465960x401814b52ec3a568 | 4.82203057925601450x401349c26258ddb7 | 4.8220305792560150x401349c26258ddb8 | Excel 16.0 build 20527, Windows; bitness and CPU not recorded in this reading |
Correct value: ln 2, correctly rounded.
Correct value: ln 2, correctly rounded.
Correct value: mpmath loggamma at 800 bits from the binary64 input, correctly rounded.
Basis: 6,000 of 6,000 fractions at each n from 3 to 7, 30,000 answers, from Excel's own GAMMALN(2+y) (build 20527). The descending product fits 5,430 to 5,527 of 6,000. Replayed for this note in exact rational arithmetic with a correctly rounded logarithm on 300 of those fractions: 300 of 300 at n = 3 to 6, and 299 of 300 at n = 7. Recorded rows match GAMMALN 2,106 of 4,538 and GAMMALN.PRECISE 10,627 of 14,278, with stand-ins for the bands below 3.
Inferred: That GAMMALN.PRECISE takes the same route is inferred: the 30,000 answers are GAMMALN, and the two functions agree at every shared recorded input tried, including 3.
Open: The rationals below 3. They are rationals in x itself, [1.5,2) and [2,3] are separate bands, and their tables are not identified: no rescaled Cody-Hillstrom table and no fresh minimax table tried reproduces the steps of their mean error.
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
- CalcFunc-Evidence · cache/oracle/build-20131/GAMMALN.jsonl.gz 4d5320dfdc385354469b4d506153357bb932ab08 · line 273, key GAMMALN|0x4008000000000000
- CalcFunc-Evidence · cache/oracle/build-20131/GAMMALN.PRECISE.jsonl.gz 4d5320dfdc385354469b4d506153357bb932ab08 · line 22, key GAMMALN.PRECISE|0x4008000000000000
- ExcelFunctionsHandbook · content/notes/evidence/2026-11-04/gamma-readings.tsv b5d84a80a5a4640eca9ce04f232c0bc115503f34 · GAMMALN 4000296a5d874ad0
- ExcelFunctionsHandbook · content/notes/evidence/2026-11-04/gamma-readings.tsv b5d84a80a5a4640eca9ce04f232c0bc115503f34 · GAMMALN 401814b52ec3a568