Problem with polynomial roots.

Discussion in 'Physics & Math' started by Dinosaur, Apr 27, 2002.

  1. Dinosaur Rational Skeptic Valued Senior Member

    Messages:
    4,885
    I 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?
     
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. itchy Registered Senior Member

    Messages:
    47
    Can'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.
     
  4. Google AdSense Guest Advertisement



    to hide all adverts.
  5. ChristCrusher Registered Senior Member

    Messages:
    63
    do you really mean precision?

    i think you mean accuracy problems
     
  6. Google AdSense Guest Advertisement



    to hide all adverts.

Share This Page