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
 Dieter Senior Member Posts: 2,397 Joined: Dec 2013
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
 « Next Oldest | Next Newest »

 Messages In This Thread Gamma Function by Stieltjes Continued Fraction - lcwright1964 - 09-01-2015, 10:31 PM RE: Gamma Function by Stieltjes Continued Fraction - Dieter - 09-02-2015, 10:53 AM RE: Gamma Function by Stieltjes Continued Fraction - Dieter - 09-03-2015, 08:10 PM RE: Gamma Function by Stieltjes Continued Fraction - lcwright1964 - 09-04-2015, 01:54 AM RE: Gamma Function by Stieltjes Continued Fraction - Dieter - 09-04-2015, 06:29 AM RE: Gamma Function by Stieltjes Continued Fraction - lcwright1964 - 09-04-2015, 06:32 PM RE: Gamma Function by Stieltjes Continued Fraction - Dieter - 09-05-2015, 05:49 AM RE: Gamma Function by Stieltjes Continued Fraction - lcwright1964 - 09-05-2015, 09:55 PM RE: Gamma Function by Stieltjes Continued Fraction - Gerald H - 09-06-2015, 06:40 AM RE: Gamma Function by Stieltjes Continued Fraction - lcwright1964 - 09-06-2015, 03:07 PM RE: Gamma Function by Stieltjes Continued Fraction - Dieter - 09-09-2015 09:21 PM RE: Gamma Function by Stieltjes Continued Fraction - lcwright1964 - 09-10-2015, 10:51 PM RE: Gamma Function by Stieltjes Continued Fraction - Dieter - 09-11-2015, 08:14 PM RE: Gamma Function by Stieltjes Continued Fraction - lcwright1964 - 09-13-2015, 02:06 AM RE: Gamma Function by Stieltjes Continued Fraction - Dieter - 09-13-2015, 01:55 PM

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