Function note

GAMMALN from 3 to 8 is a stored recurrence, and GAMMALN(3) is one unit above ln 2

FUNC.GAMMALN · FUNC.GAMMALN.PRECISE

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 routeInputsExcelCorrect valueRecorded in
GAMMALN(3)
cell-value2
x: 3
0x4008000000000000
0.6931471805599454
0x3fe62e42fefa39f0
0.6931471805599453
0x3fe62e42fefa39ef
Excel 16.0 build 20131, platform and bitness not recorded, AMD Ryzen 7 4800H
GAMMALN.PRECISE(3)
cell-value2
x: 3
0x4008000000000000
0.6931471805599454
0x3fe62e42fefa39f0
0.6931471805599453
0x3fe62e42fefa39ef
Excel 16.0 build 20131, platform and bitness not recorded, AMD Ryzen 7 4800H
GAMMALN(2.020222407046596)
cell-value2
x: 2.020222407046596
0x4000296a5d874ad0
0.008681034861562235
0x3f81c75cc69b54fc
—Excel 16.0 build 20527, Windows; bitness and CPU not recorded in this reading
GAMMALN(6.020222407046596)
cell-value2
x: 6.020222407046596
0x401814b52ec3a568
4.8220305792560145
0x401349c26258ddb7
4.822030579256015
0x401349c26258ddb8
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

Machine-readable note records