giordano / PolynomialRoots.jl

Fast complex polynomial root finder, with support for arbitrary precision calculations
Other
53 stars 15 forks source link

Problem when last coefficient is not zero. #11

Closed yhkalayci closed 4 years ago

yhkalayci commented 4 years ago

I realized that when the last coefficient of the polynomial is not zero, the algorithm might get confused. For example:

roots([0, 1, 4, 1, 0, 0, 0]) produces -0.0 - 0.0im
-0.0 - 0.0im
-6120.14...+ 1922.269..im -3.73... + 0.0im -0.267... + 0.0im 0.0 + 0.0im

but the actual result: roots([0, 1, 4, 1]) produces -3.732...+ 0.0im -0.267... - 0.0im 0.0 + 0.0im