32.3 Roots of Cubic Polynomials

This solves the cubic polynomial equation

$\displaystyle x^3+a_2x^2+a_1x+a_0$ $\displaystyle =$ $\displaystyle 0,$ (32.2)

where $ a_2$,$ a_1$ and $ a_0$ are real. Rather than calculating the roots by the analytical formulas, a special technique has been devised to pinpoint down one of the real roots by iteration. After rescaling the cubic polynomial coefficients such that $ -1\leq a_2,a_1,a_0 \leq +1$ and classifying the rescaled cubic polynomials into 6 classes, an analysis of the real root(s) surfaces for each class enables one to find an optimum starting point for a fast convergent Newton-Raphson iteration. In rare cases when the Newton-Raphson iterations start oscillating around the root due to numerical rounding errors, a bisection iteration follows to get the root to within machine accuracy. Details of this procedure can be found in Flocke 2015. After one of the real roots has been found, the remaining roots (real or complex) are found by solving the residual quadratic, which is obtained by composite (forward/backward) deflation.