SciForums.com > Science > Physics & Math > Problem with polynomial roots. PDA View Full Version : Problem with polynomial roots. Post ReplyCreate New Thread Dinosaur04-26-02, 11:43 PMI have written a VB application which finds polynomial roots. It seems to work very well except for an occasional root whose precision is questionable. The application calculates the sum and product of the roots to verify precision and logic. In every case, comparison of the sum of the roots with the second coefficient indicates that the sum of the roots is precise to 9 or more digits. Similarly, the product of the roots compared to the constant coefficient indicates 9 or more digits of precision. In most cases all roots seem to be precise to 9 or more digits. For some polynomials, the precision of one root is questionable. When the polynomial is evaluated using that root the result is zero to only 2-6 digits of precision. The other roots seem to be precise to 9 or more digits. There could be a subtle bug in program logic. It could also be that when evaluating some polynomials for certain values, there is significant loss of precision. The latter could happen if two nearly equal values are subtracted at some point in the computation. Investigating either explanation for the loss of precision is likely to be time consuming, since the problem has so far occurred only with high order polynomials (order 15 or more). Does anybody have an opinion on the above? Does anybody have some experience or special knowledge which might shed some light on this subject? itchy04-27-02, 01:21 PMCan't you rewrite your code to avoid cancellations? Also, if you have a sum you should start adding the smallest values. But perhaps you are doing this allready. ChristCrusher05-02-02, 02:00 PMdo you really mean precision? i think you mean accuracy problems Post ReplyCreate New Thread