JasonD
10-12-2006, 02:43 PM
I found a sample page from "NUMERICAL RECIPES IN C: THE ART OF SCIENTIFIC COMPUTING" for the section 5.6 Quadratic and Cubic Equations. There appears to be an error. The text states:
"If Q and R are real (always true when a, b, c are real) and R^2 < Q^3, then the cubic equation has three real roots."
and follows that if this is not the case, then there is only 1 real root, and 2 complex roots.
However, I believe if R^2 = Q^3, there are are still three real roots, where two of them are identical.
Can anyone else confirm this?
(Since I don't have the book, I do not know if this is replicated in the code samples.)
"If Q and R are real (always true when a, b, c are real) and R^2 < Q^3, then the cubic equation has three real roots."
and follows that if this is not the case, then there is only 1 real root, and 2 complex roots.
However, I believe if R^2 = Q^3, there are are still three real roots, where two of them are identical.
Can anyone else confirm this?
(Since I don't have the book, I do not know if this is replicated in the code samples.)