Skip to content
Numerical Method , home
Menu

Forum Numerical Method Analysis

How do we scale coefficients in a polynomial to avoid overflow / underflow?

  1. Ken YiuParticipant 2010-05-27 at 6:32 am

    I read a program which states that we should scale a polynomial by the following factor:

    <br />
    scale = ( Double.MIN_VALUE / MACHINE_EPSILON ) / minAbsCoeff;<br />
    factor = pow(2.0, (int) (log(scale) / log(2) + 0.5));<br />
    

    where [tt:13jpjb3g]MACHINE_EPSILON[/tt:13jpjb3g] is the difference between 1 and the smallest exactly representable number greater than 1, [tt:13jpjb3g]minAbsCoeff[/tt:13jpjb3g] is the minimum of the absolute value of the coefficients.

    How can this scaling avoid overflow/underflow?