The Museum of HP Calculators

HP Forum Archive 19

[ Return to Index | Top of Index ]

Improved Internal Accuracy in Newest Version of Free42
Message #1 Posted by Les Wright on 11 Aug 2009, 10:00 p.m.

Hugh Steers responded to me recently in some detail when I wrote to compliment and thank him for revisions to his BCD-20 library that has made Free42 even more accurate than before. It looks like transcendental and special functions (like GAMMA and !) have been improved to give 25 digits of internal accuracy within 1 ulp in most cases.

Most intriguing for me was the claimed improvements in the integration algorithm. Hugh has improved the Romberg code to incorporate the variable transformations described by Kahan in his December 1980 HP digest paper (on the MOHPC DVD). In experimenting with the pathological integral described by Kahan in that same article, I have been able to get it correct to 23 digits within 5 ulp by setting ACC to the absurd 1e-23. I was using Free42 Decimal 1.4.52 on my Palm XT, and this took a few minutes, but it worked. In previous versions of Free42, the integrator would not return a result if ACC was smaller than 1e-13 or 1e-14.

Byron Foster has told me that the next release of 42S for iPhone will incorporate this most up to date math code.

I thought this info would be of interest to those who love Free42 in its various incarnations. Numerical integration is hot topic around here occasionally and I thought that these refinements would be of great interest to some.

Les

Edited: 11 Aug 2009, 10:06 p.m.

      
Re: Improved Internal Accuracy in Newest Version of Free42
Message #2 Posted by hugh steers on 12 Aug 2009, 10:07 a.m.,
in response to message #1 by Les Wright

Hi, Thanks for the compliment.

This is true, although the original code still applied the transformation. This "trick" is described in the HP15c advanced function handbook page 46. you set x = u/2*(3-u^2) and integrate u. This changes the Romberg integrand into an open form and, according to the book "suppresses resonance". Unfortunately, the old code suffered from a defect in the Richardson extrapolation logic (part of the Romberg method) that meant many more function evals were being called than necessary. This has been fixed. Also, i'm hoping the error estimate returned in Y is more accurate.

Edited: 12 Aug 2009, 10:07 a.m.

            
Re: Improved Internal Accuracy in Newest Version of Free42
Message #3 Posted by Les Wright on 12 Aug 2009, 7:01 p.m.,
in response to message #2 by hugh steers

Quote:

Also, i'm hoping the error estimate returned in Y is more accurate.


Hugh, I should look at the code myself and try to decipher, but could you tell me what you use for the error estimate? I am assuming the difference between the final and penultimate approximation to the integral that satisfies the relative error requirement stored in ACC?

Thanks in advance,

Les


[ Return to Index | Top of Index ]

Go back to the main exhibit hall