• Kutalmis Bercin's avatar
    ENH: improve stability in polynomialEqns · 8ca724ff
    Kutalmis Bercin authored
      - replaces floating-point equal comparisons in
        `linearEqn`, `quadraticEqn`, and `cubicEqn`,
      - ensures `quadraticEqn` and `cubicEqn` can return `complex` roots,
      - reorders if-branches in `quadraticEqn` and `cubicEqn` to avoid
        zero-equal comparison,
      - adds Kahan's cancellation-avoiding algorithm into `quadraticEqn` and
        `cubicEqn` for the numerically-sensitive discriminant computation,
      - adds/improves `polynomialEqns` tests:
        * adds Test-linearEqn.C
        * adds Test-quadraticEqn.C
        * improves Test-cubicEqn.C
options 22 Bytes