functioncubicRoots_Real

Analytical solution for the real roots of a cubic equation (a*x^3+b*x^2+c*x+d=0)

Information

Uses ccubicRoots but only returns on the real portion of the roots (i.e., roots[*] = Real). If a root has a imaginary portion greater than machine tolerance than a dummy value is returned for that root.

nRoots helps to identify the number of expected real roots based on the result from the polynomial discriminant, D.

Inputs

TypeNameDefaultDescription
Reala
Realb
Realc
Reald

Outputs

TypeNameDefaultDescription
RealrootsReal roots
RealnRootsNumber of distinct real solutions expected