Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing root and extra roots #2

Open
dstahlke opened this issue Nov 1, 2023 · 1 comment
Open

Missing root and extra roots #2

dstahlke opened this issue Nov 1, 2023 · 1 comment

Comments

@dstahlke
Copy link

dstahlke commented Nov 1, 2023

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()
@dstahlke
Copy link
Author

dstahlke commented Nov 1, 2023

With isolation=false, the two invalid roots are the real parts of the complex roots.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant