Find the real roots of huge polynomials in milliseconds
cargo build --release
The coefficients are in degree-ascending order, that is:
The coefficients are passed space-separated, therefore to solve the polynomial
$ cargo install polynomial-roots
$ polynomial-roots
3 -9 0 1
{ -3.154523; 0.33760893; 2.816914; }
(note: don't forget the zero coefficients)
The roots are found using the linear formula (
If you aren't getting all the roots you should modify the constants from the file src/constants.rs
. You can DECREASE PARTITION_SIZE
and INCREASE ITERATIONS
. That will make the program slower, but with the right tweaks it can solve any polynomial.