The Museum of HP Calculators

HP Forum Archive 14

[ Return to Index | Top of Index ]

GAMMA on the 17bII+
Message #1 Posted by Bob Wang on 15 Jan 2005, 3:38 p.m.

OK, here’s another in the category of “Why even bother?” Eddie’s post on “L, G, and some trig functions” inspired me to implement GAMMA on the 17bII+.

Victor T. Toth’s page on “Calculators and the Gamma Function” is an excellent resource, and I’ve used his listing of the Lanczos approximation.

ONLY valid for POSITIVE values of z. The SIN identity for negative values of z COULD be used IF the 17bII+ had a built-in SIN function. Coding the extra steps to calculate SIN results in the now familiar overflow condition of GAMMA being returned as being 0.

Pretty simple, pretty accurate for positive z, pretty useless ;-)

Bob Wang

Eddie Shore’s post on “L, G, and some trig functions”

Calculators and the Gamma Function

GAMMA: (75122.6331530 +80916.6278952×Z +36308.2951477×Z^2 +8687.24529705×Z^3 +1168.92649479×Z^4 +83.8676043424×Z^5 +2.50662827511×Z^6) ÷Z÷(Z+1)÷(Z+2)÷(Z+3)÷(Z+4)÷(Z+5)÷(Z+6) ×(Z+5.5)^(Z+.5) ×EXP(-(Z+5.5)) -GAMMA


[ Return to Index | Top of Index ]

Go back to the main exhibit hall