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
| Type | Name | Default | Description |
|---|---|---|---|
| Real | a | ||
| Real | b | ||
| Real | c | ||
| Real | d |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real | roots | Real roots | |
| Real | nRoots | Number of distinct real solutions expected |