solveCubic
Solves a cubic equation of the form ax^3 + bx^2 + cx + d = 0 and returns its real roots.
Return
A DoubleArray containing the real roots of the cubic equation. The number of roots in the array will depend on the nature of the cubic equation.
Parameters
a
Coefficient of the cubic term (x^3).
b
Coefficient of the quadratic term (x^2).
c
Coefficient of the linear term (x).
d
Constant term.