skip to main content

Algorithm 954: An Accurate and Efficient Cubic and Quartic Equation Solver for Physical Applications

Authors Info & Claims
Published:12 October 2015Publication History
Skip Abstract Section

Abstract

We report on an accurate and efficient algorithm for obtaining all roots of general real cubic and quartic polynomials. Both the cubic and quartic solvers give highly accurate roots and place no restrictions on the magnitude of the polynomial coefficients. The key to the algorithm is a proper rescaling of both polynomials. This puts upper bounds on the magnitude of the roots and is very useful in stabilizing the root finding process. The cubic solver is based on dividing the cubic polynomial into six classes. By analyzing the root surface for each class, a fast convergent Newton-Raphson starting point for a real root is obtained at a cost no higher than three additions and four multiplications. The quartic solver uses the cubic solver in getting information about stationary points and, when the quartic has real roots, stable Newton-Raphson iterations give one of the extreme real roots. The remaining roots follow by composite deflation to a cubic. If the quartic has only complex roots, the present article shows that a stable Newton-Raphson iteration on a derived symmetric sixth degree polynomial can be formulated for the real parts of the complex roots. The imaginary parts follow by solving suitable quadratics.

Skip Supplemental Material Section

Supplemental Material

References

  1. D. W. Arthur. 1972. Extension of Bairstow’s method for multiple quadratic factors. J. Inst. Math. Appl. 9 (1972), 194--197.Google ScholarGoogle ScholarCross RefCross Ref
  2. L. Bairstow. 1914. Investigations Relating to the Stability of the Aeroplane. Reports and Memoranda 154. National Advisory Committee for Aeronautics.Google ScholarGoogle Scholar
  3. B. Christianson. 1991. Solving quartics using palindromes. Math. Gaz. 75 (1991), 327--328.Google ScholarGoogle ScholarCross RefCross Ref
  4. J. Dexter and E. Agol. 2009. A fast new public code for computing photon orbits in a Kerr spacetime. Astrophys. J. 696 (2009), 1616--1629.Google ScholarGoogle ScholarCross RefCross Ref
  5. M. Fujiwara. 1916. Über die obere Schranke des absoluten Betrages der Wurzeln einer algebraischen Gleichung. Tohoku Math. J. 10 (1916), 167--171.Google ScholarGoogle Scholar
  6. G. H. Golub and C. F. Van Loan. 1990. Matrix Computations (2nd ed.). Johns Hopkins University Press, Baltimore, MD.Google ScholarGoogle Scholar
  7. S. Graillat, P. Langlois, and N. Louvet. 2009. Algorithms for accurate, validated and fast polynomial evaluation. Japan J. Indust. Appl. Math. 26 (2009), 2--3, 191--214.Google ScholarGoogle ScholarCross RefCross Ref
  8. D. Herbison-Evans. 1995. Solving quartics and cubics for graphics. In Graphics Gems V, A. Paeth (Ed.). Academic Press, Chesnut Hill, 3--15.Google ScholarGoogle Scholar
  9. M. A. Jenkins. 1975. Algorithm 493: Zeros of a real polynomial. ACM Trans. Math. Software 1, 2 (1975), 178--189. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. A. Jenkins and J. F. Traub. 1970. A three-stage algorithm for real polynomials using quadratic iteration. SIAM J. Numer. Anal. 7 (1970), 545--566.Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. T. B. Kaiser. 2000. Laser ray tracing and power deposition on an unstructured three-dimensional grid. Phys. Rev. E 61 (2000), 895--905.Google ScholarGoogle ScholarCross RefCross Ref
  12. A. Lucia. 2010. A multiscale Gibbs-Helmholtz constrained cubic equation of state. J. Thermodyn. 2010, 1--10.Google ScholarGoogle Scholar
  13. J. M. McNamee. 1993. A bibliography on roots of polynomials. J. Comput. Appl. Math. 47 (1993), 391--394. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. J. M. McNamee. 1999. An updated supplementary bibliography on roots of polynomials. J. Comput. Appl. Math. 110 (1999), 305--306. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. D. A. McQuarrie and J. D. Simon. 1999. Molecular Thermodynamics. University Science Books, Sausalito, CA.Google ScholarGoogle Scholar
  16. S. Neumark. 1965. Solution of Cubic and Quartic Equations (1st ed.). Pergamon Press, Oxford.Google ScholarGoogle Scholar
  17. G. Peters and J. H. Wilkinson. 1971. Practical problems arising in the solution of polynomial equations. J. Inst. Math. Appl. 8 (1971), 16--35.Google ScholarGoogle ScholarCross RefCross Ref
  18. W. H. Press, S. A. Teukolsky, W. T. Vetterling, and B. P. Flannery. 2007. Numerical Recipes: The Art of Scientific Computing (3rd ed.). Cambridge University Press, New York, NY. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. E. L. Rees. 1922. Graphical discussion of the roots of a quartic equation. Amer. Math. Monthly 29, 2 (1922), 51--55.Google ScholarGoogle ScholarCross RefCross Ref
  20. V. M. Shah, P. R. Bienkowski, and H. D. Cochran. 1994. Generalized quartic equation of state for pure nonpolar fluids. AIChE J. 40 (1994), 152--159.Google ScholarGoogle ScholarCross RefCross Ref
  21. S. L. Shmakov. 2011. A universal method of solving quartic equations. Int. J. Pure Appl. Math. 71 (2011), 251--259.Google ScholarGoogle Scholar
  22. P. Strohbach. 2010. The fast quartic solver. J. Comput. Appl. Math. 234 (2010), 3007--3024. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. P. Strohbach. 2011. Solving cubics by polynomial fitting. J. Comput. Appl. Math. 235 (2011), 3033--3052. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. F. Viéte. 1579. Opera Mathematica.Google ScholarGoogle Scholar
  25. Wolfram Research. 2011. Mathematica 8. Software.Google ScholarGoogle Scholar
  26. M. D. Yacoub and G. Fraidenraich. 2012. A solution of the general quartic equation. Math. Gaz. 96 (2012), 271--275.Google ScholarGoogle ScholarCross RefCross Ref
  27. Y.-K. Zhu and W. B. Hayes. 2010. Algorithm 908: Online exact summation of floating-point streams. ACM Trans. Math. Softw. 37, 3, Article 37 (Sept. 2010). Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Algorithm 954: An Accurate and Efficient Cubic and Quartic Equation Solver for Physical Applications

    Recommendations

    Reviews

    Beny Neta

    Flocke developed an algorithm for obtaining all the zeros of cubic and quartic polynomials. The key to accuracy is scaling the polynomials so that all coefficients in absolute value are bounded by unity. A recent book by Boyd [1] contains a chapter on the zeros of cubic and a chapter on the zeros of quartic polynomials. For the cubic solver, the algorithm considers six classes based on the sign of each coefficient. For each class, one can find a good starting value for Newton's method to converge fast to the desired root. For the quartic solver, the algorithm uses the cubic solver to find the three stationary points. In the cases of real roots, Newton's method is used to get the extreme real root. Deflation is used to get the other roots. If the quartic has only complex roots, a sixth degree polynomial is constructed to obtain the real parts of those roots and a quadratic polynomial is used to get the imaginary parts. Examples showing the efficiency and accuracy of the solver for both the cubic and quartic polynomials are given. It would be interesting to compare this algorithm to the one suggested by Boyd. Online Computing Reviews Service

    Access critical reviews of Computing literature here

    Become a reviewer for Computing Reviews.

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in

    Full Access

    • Published in

      cover image ACM Transactions on Mathematical Software
      ACM Transactions on Mathematical Software  Volume 41, Issue 4
      October 2015
      160 pages
      ISSN:0098-3500
      EISSN:1557-7295
      DOI:10.1145/2835205
      Issue’s Table of Contents

      Copyright © 2015 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 12 October 2015
      • Accepted: 1 November 2014
      • Revised: 1 September 2014
      • Received: 1 October 2013
      Published in toms Volume 41, Issue 4

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article
      • Research
      • Refereed

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader