Post Reply 
HP41: accuracy of 13-digit routines
09-03-2015, 12:36 PM (This post was last modified: 09-03-2015 12:36 PM by Dieter.)
Post: #10
RE: HP41: accuracy of 13-digit routines
(09-03-2015 06:22 AM)Ángel Martin Wrote:  I don't know if there were changes made to the 15C MCODE, but I can tell you that on the 41 the square root at least is far from being that accurate. If you do a chained calculation in MCODE with [SQR-13] followed by a 13-digit multiplication you not always get the same original argument to the 13th. digit....

Well, I hope so. ;-) Squaring a root that is exact in all digits does not neccessarily yield the original number. For instance, there simply is no 10-digit value for √2 that, if squared, would return 2 again. You get either 1,999999999 or 2,000000002.

With 13 digits the same applies to √7. The (truncated) root is 2,645751311064, and if [SQR-13] returns this result, everything is fine. Even though this value squared gives 6,999999999996 resp. ...997. Even if the root was correctly rounded to 13 digits instead of truncated, the square of this would not return 7 but 7,000000000002.

(09-03-2015 06:22 AM)Ángel Martin Wrote:  the X! on the 15C is the gamma function, right? So there you also have it to test for the accuracy to the 10th decimal digit.

Yes, on the 15C x! actually evaluates Gamma(x+1), just like the 34C did before. The 15C AFH says that the last digit may be off by 1 ULP, maybe 2 for large results.

(09-03-2015 06:22 AM)Ángel Martin Wrote:  As far as GAMMA in the SandMath I checked the accuracy for the natural arguments were ok (see the table in its manual) but didn't do any further checks for non-integer arguments.

Here and there the result may be off in the last digit, but the cases I found were just 1 ULP high or low. So it seems on par with the 15C. ;-)

BTW, have you read the recent thread on Spouge's Gamma approximation in the HP41 software library? Les and I have been talking about an improved Lanczos method, and I posted a set of coefficents resulting in a relative error less than 2 E–11 up to Gamma(71), and this with even two terms less than the current Sandmath implementation.

(09-03-2015 06:22 AM)Ángel Martin Wrote:  BTW there's also exponentials in the Lanczos formula, as well as sine factors in the reflection formula.

Yes. An that's what will limit the accuracy of the final result.

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


Messages In This Thread
RE: HP41: accuracy of 13-digit routines - Dieter - 09-03-2015 12:36 PM



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