[wp34s] Poly root finders?
|
12-07-2015, 08:05 PM
(This post was last modified: 12-07-2015 08:26 PM by fhub.)
Post: #14
|
|||
|
|||
RE: [wp34s] Poly root finders?
(12-07-2015 05:40 PM)emece67 Wrote: Well, I think I understand it except for the very last lines.OMG, do you really expect that I remember this after almost 4 years? Well, after a quick look at the code I think it was about getting 'prettier' results (in some cases). Assume that any root of the polynomial is exactly 2.345, but since this is an approximate method it may finish with a value of 2.34499999.....99978 (with the used eps=1e-15 the inaccuracy should happen around digit 15 internally). Now I round this value to 12 digits and to 10 digits, and if these rounded values (in this case both would be 2.345000...) are identical, I just use this rounded value instead of the 15-digit approximation. [Edit:] Many testsuites for polynomial rootsolvers even use examples with integer roots, e.g. (x-2)^10 or (x-1)*(x-2)*(x-3)*... etc., and with my rounding routine I get indeed exact results. Franz |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)