Post Reply 
Gamma Function Using Spouge's Method
08-20-2015, 11:36 AM (This post was last modified: 08-20-2015 11:45 AM by Dieter.)
Post: #9
RE: Gamma Function Using Spouge's Methjod
(08-19-2015 08:56 PM)Ángel Martin Wrote:  Yes I used 13-digit routines for the MCODE version in the SandMath, which uses the Lanczos formula - and indeed the result for x=70.9575744 is exactly:

I wouldn't have expected anything less. ;-)

The accuracy of the Lanczos method, like many others, increases with the argument. The larger x, the more valid digits you get, c.f. Peter Luschny's Gamma/factorial pages. So large values are the easy part.

Now the trick is to set a minimum x with sufficient accuracy for which the Lanczos (or another) approximation is applied, and evaluate Gamma for smaller arguments by the usual shift/divide trick.

BTW, Sandmath's GAMMA nicely overflows at x=70,95757446 while x=70,95757445 returns 9,999999688 E+99 (exact: ...687).

Dieter
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Gamma Function Using Spouge's Methjod - Dieter - 08-20-2015 11:36 AM



User(s) browsing this thread: 3 Guest(s)