Post Reply 
Gamma Function Using Spouge's Method
08-12-2015, 06:03 PM
Post: #5
RE: Gamma Function Using Spouge's Methjod
(08-12-2015 05:39 PM)Dieter Wrote:  So indeed the working precision has to be greater than the desired accuracy of the result. I assume that 13 digits would suffice for a 10 digit result. But this cannot be accomplished in a simple user program. On the '41, a 13-digit MCode implementation would be possible.

Indeed. I believe this is exactly what we have in Angel Martin's SANDMATH.

Some years back I was quite engaged with approximating gamma. I learned that Lanczos and Spouge were attractive to some because they were convergent and as such one didn't get into the shift and divide thing for small arguments. Despite this, I think that programmers to this day go with the good old-fashioned Stirling's series, since in practice Spouge and Lanczos don't offer much more in the way of efficiency or accuracy.

That said, I really can see that calculator programmers are drawn to the Spouge formula, as the coefficients are computed simply and on the fly. Nonetheless, JM Baillairds excellent GAM+ program in the old HP41 program archive here cleverly rearranges a truncated Stirling approximation in a way that maximizes efficiency and storage of coefficients.

Les
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 - lcwright1964 - 08-12-2015 06:03 PM



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