Solve a cubic equation

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.

Enter the coefficients:
a =
b =
c =
d =

Calculation results appear here.

Given three real roots, generate the coefficients. (This also places the coefficients into the equation solving form above.)

Enter the three roots:
Root 1 =
Root 2 =
Root 3 =