The Museum of HP Calculators

HP Forum Archive 16

[ Return to Index | Top of Index ]

Free42 Integration "Bug"
Message #1 Posted by Les Wright on 4 Jan 2007, 1:36 p.m.

Lovers of Thomas Okken's excellent simulator may find this interesting. I have let Thomas know about it so he can refine as he wishes, but in the meantime there is an easy workaround.

I have discovered that in Free42 the ACC parameter for the integrator actually is treated as the target ABSOLUTE error specified by the user, whereas in the actual calculator it is supposed to be the relative error (cf. Owner's Manual p. 203). This gives misleading results when computing integrals where the magnitudes are quite small.

For example, when computing the integral of exp(-1/x^2)/x^2 from 0 to 0.1, using an ACC of, say, 0.0001 results in a pretty good result on the calculator but a bad result in Free42. However, if one specifies a desired absolute error (the integral result is of the order of 1.9e-45, so, say 1e-50), you get a more sensible result in Free42. But use such a tiny value for ACC on the 42s, of course the thing will never converge.

I have let Thomas know about this since I know he is keen to make Free42 a completely faithful simulation of the real calculator.

Les

      
Re: Free42 Integration "Bug"
Message #2 Posted by Les Wright on 5 Jan 2007, 11:58 a.m.,
in response to message #1 by Les Wright

Thomas has been in touch with me and does indeed confirm that he has programmed the ACC parameter to be be an absolute, not relative, error stopping criterion for Free42's version of the Romberg algorithm. He will fix it in the next version of Free42 so that the simulator behaves as the actual calculator does in this regard.

Les

            
Re: Free42 Integration "Bug"
Message #3 Posted by Les Wright on 6 Jan 2007, 1:43 p.m.,
in response to message #2 by Les Wright

Thomas has just released Free 1.4.28, with the INTEG issue fixed. The integrator now treats the ACC parameter as it does in the real 42S.

Les

                  
Re: Free42 Integration "Bug"
Message #4 Posted by Namir on 6 Jan 2007, 5:44 p.m.,
in response to message #3 by Les Wright

Thanks Les for flagging the update!!

Thanks Thomas for the update!

Namir

                        
You're welcome! (NT)
Message #5 Posted by Thomas Okken on 6 Jan 2007, 11:34 p.m.,
in response to message #4 by Namir

      
Re: Free42 Integration "Bug"
Message #6 Posted by Karl Schneider on 7 Jan 2007, 1:38 a.m.,
in response to message #1 by Les Wright

Quote:
I have discovered that in Free42 the ACC parameter for the integrator actually is treated as the target ABSOLUTE error specified by the user, whereas in the actual calculator it is supposed to be the relative error (cf. Owner's Manual p. 203). This gives misleading results when computing integrals where the magnitudes are quite small.

For some more background about the function-accuracy variable, display settings and their application to numerical integration on RPN-based HP calculators, one can find my article #556 in the MoHPC Articles Forum:

HP SOLVE/INTEG on all RPN-based models

Why, some people -- including yours truly -- even argue extensively about it! Here's a lengthy thread:

Uncertainty and accuracy for numerical integration

Good catch, Les, and thank you, Thomas.

-- KS

Edited: 7 Jan 2007, 2:04 a.m.

            
Re: Free42 Integration "Bug"
Message #7 Posted by Les Wright on 7 Jan 2007, 10:58 a.m.,
in response to message #6 by Karl Schneider

I have examined your article and the thread referred to and I am even more gratified that Thomas has made this revision to bring the Free42 behaviour in line with that of the actual 42S. The ability to specify a desired relative accuracy a priori, and to do so directly rather than indirectly through the display settings, is for me a clearer and more intuitive feature.

The simulation of the integration and solver features in Free42 inspires me to declare yet again that Free42 on a Palm or PocketPC device with a reasonable size screen is just about the most gratifying handheld HP simulation experience to be had at the present time. It is also darned fast--On my Palm TX, the Free42 integrator will yield the result of Professor Kahan's famous integral to full display accuracy in a couple of seconds with setting ACC = 1e-10 and making the substition x = w^2 as advised in the original Aug 1980 HP Journal article. Even on the original untransformed integral I get 9 digit accuracy in only a few seconds.

For fun, I have ported the IG routine from the PPC ROM to Free42, and get similar fast integration speeds, with the added advantage of seeing the interim results (the diagonal elements of the Romberg matrix).

Keep up the great work Thomas! I actually use Free42 more than the actual calculator.

Les


[ Return to Index | Top of Index ]

Go back to the main exhibit hall