Root-Finder
Root-Finder copied to clipboard
Missing root and extra roots
Eigen::VectorXd p(6);
p << 384, -960, 960, -36.6926, 179677, 98925.7;
double const tmin = -10.0;
double const tmax = 10.0;
double const tol = 1e-9;
bool const isolation = false;
solvePolynomial(p, tmin, tmax, tol, isolation);
This should have one root at -0.5490372529219106. With isolation=true, no roots are found. With isolation=false, three roots are found: the correct one plus two invalid ones.
In python:
import numpy
p = numpy.polynomial.polynomial.Polynomial([98925.7, 179677, -36.6926, 960, -960, 384])
p.roots()
With isolation=false, the two invalid roots are the real parts of the complex roots.