|Re: Polynomial roots again ...|
Message #5 Posted by fhub on 27 Dec 2011, 6:44 a.m.,
in response to message #4 by Werner
x^30 - 200*x^2 + 40*x - 2 = 0
has two roots that agree to 16 digits, yet are distinct:
By making the order of the first term larger, you can get the roots arbitrarily close, but still distinct. This means that your routine to eliminate multiplicity in roots will not apply here, but numerically they will be treated as multiple roots, resulting in slower convergence and loss of accuracy. The HP48, working with 15 internal digits, returns
losing *nine* digits.
I've now played a bit with your polynomial above, and of course 'distinct' roots which agree to 16 digits are just beyond the calculation accuracy of PRS (or should I say WP34s?).
In line 402 of PRS there's my 'multiple root threshold' (SDL 10) which I've chosen after many tests with and without multiple roots. If I change that line to "SDL 08" then I get in fact 2 distinct roots for your polynomial, but (like the HP48) with much less significant digits - a 'multiple' root of 0.1 (which PRS returns with its default SDL 10) is definitely much more accurate than the 2 roots given by the HP48 (or if I change SDL to 08).
So I would indeed say that my program returns a much better result for this example. But as I already mentioned - if you construct polynomials with distinct roots (or root clusters) only in the 16th (or higher) digit, then you shouldn't wonder that you don't get absolutely exact results.
After your example I'm thinking about making this 'threshold' value for multiple roots (SDL 10) an option that can be changed by the user (like the accuracy 1e-15 in R99)!? OTOH this would make the usage of the program more complicated - and which user would really know when (and to which value) change this parameter for multiplicity testing ... :-(
Edited: 27 Dec 2011, 11:17 a.m.