Solve the cubic equation ax3 + bx2 + cx + d = 0 using JavaScript.
The intermediate reduced
equation t3 + pt + q = 0,
and its discriminant Δ = (p/3)3 + (q/2)2 and roots are also shown.
For a mathematical analysis, see
Solving the cubic equation.
Calculation results appear here.
Given three real roots, generate the coefficients. (This also places the coefficients into the equation solving form above.)