Post Reply 
Gamma Function by Stieltjes Continued Fraction
09-09-2015, 09:21 PM (This post was last modified: 09-09-2015 10:15 PM by Dieter.)
Post: #11
RE: Gamma Function by Stieltjes Continued Fraction
(09-06-2015 03:07 PM)lcwright1964 Wrote:  Moreover, for that particular argument even with adequate precision available GMST is only going to give 10 or 11 correct digits anyway.

The algorithm discussed in this thread is a modified three term Stieltjes approximation. The exact third coefficient should be 53/210, but here it is slightly rounded down to 1/4. This way the original continued fraction can be written in a different way with three integer constants 4, 5 and 6.

The slight variation of the third coefficient actually improves the accuracy for smaller arguments. We can now go one step further and tweak the remaining coefficients a bit. With sufficient working precision, e.g. on Free42, you may try replacing the 5 with 5,0000367 while the threshold for the shift-and-divide-routine is increased from 7 to 8. As far as I can see this delivers results with a max. relative error of about 1 E–11. This way Free42 delivers Gamma(9,25) = 69106,2268944 which is off by just 7 units in the 12th digit. With the original coefficients the error was approx. ±4 E–11.

Setting the threshold to 9 and replacing the 5 with 5,00005 will even limit the error to ~2 E–12. But this requires much more precision than the 41 can provide.

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


Messages In This Thread
RE: Gamma Function by Stieltjes Continued Fraction - Dieter - 09-09-2015 09:21 PM



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