The Museum of HP Calculators

HP Forum Archive 20

 [WP34s] The ultimate polynomial rootsolver is here ;-)Message #1 Posted by fhub on 25 Dec 2011, 9:03 a.m. Although there seems to be not much interest in polynomial rootsolving, here's finally my program for the WP34s - maybe at least a few members here will like and use it. ;-) I've put it in the Article section: http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=1133 Now I've also put the file in my download folder: http://www.hpmuseum.org/guest/fhub/prs.zip If you have any remarks, suggestions or questions about my program feel free to post them here. Of course also if you find any polynomial(s) where my program fails or gives wrong or inaccurate results - although this is very unlikely. ;-) Just in case you need a polynomial rootsolver for the PC, or if you want to test my WP34s program - here's a very interesting website about polynomial rootsolving, which has programs for the PC and also an online rootsolver: http://www.hvks.com/Numerical/winsolve.html There's also still the previous version of this 'RootFinder' program available (WinSolve), which has the advantage that it doesn't need .NET4, so this is my prefered version: http://www.hvks.com/Numerical/Downloads/winsolve.zip Merry Christmas to all, Franz Edited: 3 Jan 2012, 7:33 a.m. after one or more responses were posted

 Re: [WP34s] The ultimate polynomial rootsolver is here ;-)Message #2 Posted by Namir on 25 Dec 2011, 5:18 p.m.,in response to message #1 by fhub How does your root solver handle polynomials with a high number of duplicate roots? Such as: (x-1.234)^20 = 0 Namir

 Re: [WP34s] The ultimate polynomial rootsolver is here ;-)Message #3 Posted by fhub on 25 Dec 2011, 5:57 p.m.,in response to message #2 by Namir Quote: How does your root solver handle polynomials with a high number of duplicate roots? Such as: (x-1.234)^20 = 0 Your example above will be solved exactly - well, at least if you enter all coefficients with full precision, but that's not possible e.g. for 1.234^20. But with integer coefficients it works. The Laguerre method automatically solves all polynomials of the form (x-x0)^n correctly, and all other multiplicities within a polynomial should be solved by my special routine for multiple roots - usually exact for integer roots (and even not too 'long' rational numbers) and with about 12 or more digits precision for all other (irrational) roots. You can try the examples that Valentin has posted about a month ago (the thread is in the archive and has also a name like "polynomial roots solver"). He has given the examples (x+1)^30 and (x^2+x+1)^10 and both are solved exactly by my program. Also the example from the HP-71B paper (x+1)^20 gives absolutely correct roots, whereas the HP-71B program returns very inaccurate (I would call it even wrong) solutions. Franz Edited: 25 Dec 2011, 6:13 p.m.

 Re: [WP34s] The ultimate polynomial rootsolver is here ;-)Message #4 Posted by fhub on 26 Dec 2011, 7:17 a.m.,in response to message #2 by Namir Quote: How does your root solver handle polynomials with a high number of duplicate roots? Such as: (x-1.234)^20 = 0 Hi again, Namir! I've now written a small routine which created your above polynomial and then let my program solve it, and although of course the coefficients couldn't be stored with full precision (i.e. all digits) my PRS solver returns all 20 solutions absolutely exact as -1.234! I think that tells all about the quality of this polynomial rootsolver ... :-) Franz

 Re: [WP34s] The ultimate polynomial rootsolver is here ;-)Message #5 Posted by Neil Hamilton (Ottawa) on 26 Dec 2011, 7:21 a.m.,in response to message #4 by fhub Hmmm. Shouldn't the root have been positive 1.234? Might have some work yet. :-)

 Re: [WP34s] The ultimate polynomial rootsolver is here ;-)Message #6 Posted by fhub on 26 Dec 2011, 7:43 a.m.,in response to message #5 by Neil Hamilton (Ottawa) Quote: Hmmm. Shouldn't the root have been positive 1.234? Might have some work yet. :-) Oops, of course you're right! My short program just created (x+1.234)^20 instead of (x-1.234)^20. So everything is fine at the end ... :-)

Go back to the main exhibit hall