Post Reply 
Gamma Function Using Spouge's Method
08-26-2015, 12:50 PM
Post: #31
RE: Gamma Function Using Spouge's Methjod
(08-26-2015 09:50 AM)Dieter Wrote:  
(08-25-2015 11:29 PM)lcwright1964 Wrote:  This is excellent. I have learned that Free42 is an excellent place to observe the behaviour of HP41 programs. The programs are completely compatible without modification...

I agree that Free42 is an excellent piece of software, but I would not recommend it for testing HP41 programs. The different precision and working range may and will lead to different results....

But of course, and that's kind of my point. What I should have been clear about is that it lets me test various Gamma implementations, written in FOCAL, in a high precision environment where 12 digits--two more--are show. So I can play around with extra terms and shift-divide cutoffs and see where it is I get 10 digit accuracy where this is ample working precision. This is important to know, because when execution is confined to the 10 digit environment of the HP41 trying to squeeze out another digit by extending by an extra term or altering the shift/divide threshold (where relevant) will NOT improve things, and indeed more computations will be done that will add to rounding error. That is what I meant.

For example, in the GAM+ program of JMB that I love so much, it is evident that he worked it up in a higher precision environment, because the number of terms used and the selection of 5 as the shift/divide threshold gives at LEAST 10 good digits when there is ample working precision. This will be degraded somewhat in the HP41 10 digit environment, but adding another term, as contemplated, will NOT improve it there. It will give more digits when they are available, such as on the Free42, but won't confer any benefit on the HP41. That's what I mean.

And thank you for correcting me on the number of internal digits in Free42 Decimal. It used to be about 25-digit precision when Thomas used the BCD-10000 library. I didn't know he switched to the Intel quadruple precision library. I do suspect that not all of the Free42's functions have been extended to the higher precision. For example, I have a little program that computes the upper and lower incomplete gammas to machine convergence, and can inefficiently use them as a gold standard for the "complete" gamma--e.g., Gamma[5.5] = UpperIncompleteGamma[5.5,5.5] + LowerIncompleteGamma[5.5,5.5]. (I know this is NOT an efficient way to compute Gamma, since these incomplete gamma routines compute series and continued fractions to dozens of terms to machine convergence, but it is fast enough in Free42 at native processor speed, yet would take much longer on a real 41C or 42S.) Testing this against the Free42's built in GAM shows the latter to do no better than about 23 or 24 digits for a few arguments, so the older code is still there despite the more precise quadruple precision numbers. Practically speaking this makes no difference, and I suspect Thomas will leave it alone. The good thing about Free42's high internal precision is that you know that what you see in the display to 12 digits is completely correct (and then some) provided the algorithms are correct.

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-26-2015 12:50 PM



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