The Museum of HP Calculators

HP Forum Archive 14

[ Return to Index | Top of Index ]

Free42 1.0.4: better SOLVE and INTEG
Message #1 Posted by Thomas Okken on 7 Nov 2004, 9:05 p.m.

Hi all,

I just posted Free42 version 1.0.4 here.

It features much improved SOLVE and INTEG performance. For SOLVE, I switched from interpolating using the secant method to Ridders' method; for INTEG, I switched from using Simpson's Rule to the Romberg method. In terms of the number of times the user function has to be evaluated to get a result, these new versions are very close to the performance of the HP-42S now.

Many thanks to Hugh Steers for the Romberg implementation, and for reminding me of the Numerical Recipes book where I got the Ridders code.

- Thomas

      
Re: Free42 1.0.4: better SOLVE and INTEG
Message #2 Posted by hugh steers on 8 Nov 2004, 4:05 a.m.,
in response to message #1 by Thomas Okken

the Romberg version uses a refinement suggested in the 15c advanced function handbook and used by the 15c and others to redistribute the samples in a clever way. ive found this simple transform to be very effective and substantially improves this method over the usual textbook “Romberg” implementation.

      
Re: Free42 1.0.4: AVIEW bug
Message #3 Posted by Ton van de Burgt on 8 Nov 2004, 4:20 a.m.,
in response to message #1 by Thomas Okken

When a LF character is on the 23st place in a string, AVIEW does not show the second line, only the first line.

Regards, Ton

            
Re: Free42 1.0.4: AVIEW bug
Message #4 Posted by Thomas Okken on 8 Nov 2004, 3:33 p.m.,
in response to message #3 by Ton van de Burgt

Oops! Thanks for the heads-up.
This is what happens when I forget to compare my code's performance with the real thing... Ahem... Sorry about that.
It will be fixed in the next release, probably tomorrow.

      
Free42 1.0.4 - Pocket PC Version?
Message #5 Posted by Jeff O. on 8 Nov 2004, 7:39 a.m.,
in response to message #1 by Thomas Okken

Thomas,
Let me add my thanks and appreciation to those expressed by all of the others for your efforts.
What are the chances that a Pocket PC 2002/2003 version will be produced? (I reviewed the various messages and did not find any mention of this issue. If it has already been discussed, please forgive me.)

NO60hzSPAMatFORieeedotMEorg (remove NO SPAM FOR ME and change the at and dot.)

            
Re: Free42 1.0.4 - Pocket PC Version?
Message #6 Posted by Thomas Okken on 8 Nov 2004, 3:28 p.m.,
in response to message #5 by Jeff O.

Chances of a Pocket PC version: hmmm, well, I don't know anything about that platform. I don't own one (I'm happy with my Palm) and I don't have any tools for Pocket PC development etc.

I someone else is interested in doing it, I'll be glad to help. It's not a big task, once you understand how the core-shell interface works. For example, it took me only 3 days to write the Windows front-end, and I'm not an experienced Windows programmer.

All the OS-dependent functionality is in shell.c/shell.cpp; the three versions I have at the moment are all about 800-900 lines of code. Not trivial, but not a mega project, either.

                  
Re: Free42 1.0.4 - Pocket PC Version?
Message #7 Posted by Jeff O. on 10 Nov 2004, 7:16 a.m.,
in response to message #6 by Thomas Okken

Quote:
It's not a big task, once you understand how the core-shell interface works. For example, it took me only 3 days to write the Windows front-end, and I'm not an experienced Windows programmer.
Unfortunately, I haven't a clue about such things, so I will have to rely on the kindness of strangers. Hopefully someone as generous as you will take on this task.

NO60hzSPAMatFORieeedotMEorg (remove NO SPAM FOR ME and change the at and dot.)

                        
Re: Free42 1.0.4 - Pocket PC Version?
Message #8 Posted by Thomas Okken on 10 Nov 2004, 10:29 a.m.,
in response to message #7 by Jeff O.

If someone is willing to donate a Pocket PC plus development software, I'd be happy to take it on myself. I'll gain a new toy and a bit of resume enhancement; the community gets a new tool to make their Pocket PCs more useful. Everybody wins. :-)

      
Re: Free42 1.0.4: better SOLVE and INTEG
Message #9 Posted by Gordon Dyer on 8 Nov 2004, 6:48 p.m.,
in response to message #1 by Thomas Okken

Hi, thanks for Free42, its now running on my PC. Can you compile a WinCE version for PPC?

            
Re: Free42 1.0.4: better SOLVE and INTEG
Message #10 Posted by Thomas Okken on 8 Nov 2004, 8:28 p.m.,
in response to message #9 by Gordon Dyer

Glad you like it!
Regarding the Pocket PC: look here.

      
Re: Free42 1.0.4: better SOLVE and INTEG
Message #11 Posted by Namir on 9 Nov 2004, 1:10 p.m.,
in response to message #1 by Thomas Okken

Algorithm

The modified Bisection alters the selection of the mid-interval guess by comparing the absolute values of the functions at the interval’s ends [a. b]. The mid-interval valuae is calculated as:

m = a + 0.25 * (b – a) if |Fa| < |Fb|

or

m = a + 0.75 * (b – a) if |Fa| >= |Fb|

P-Code

Give the root-containing interval [a, b] and the tolerance of the root: 1. Let Fa = f(a) and Fb = f(b) 2. If |Fa| < |Fb| then alpha = 0.25 else alpha = 0.75 3. m = a + alpha * (b – a) 4. Let Fm = f(m) 5. If Fm * Fa > 0 then let a = m and Fa = Fm else let b = m and Fb = Fm 6. If |a – b| > Tolerance resume at step 2 7. Return root as the value of m.

Namir


[ Return to Index | Top of Index ]

Go back to the main exhibit hall