flintlib / flint

FLINT (Fast Library for Number Theory)
http://www.flintlib.org
GNU Lesser General Public License v3.0
401 stars 235 forks source link

Use Bini's algorithm to select initial values in acb_poly_find_roots #2013

Closed fredrik-johansson closed 3 weeks ago

fredrik-johansson commented 3 weeks ago

The polynomial root-finding can be improved in many ways. A simple thing implemented here is to use MPSolve's strategy to pick the initial values (if I remember correctly Guillaume Moroz suggested this to me?) instead of the previous method of choosing powers of some arbitrary fixed number.

I haven't benchmarked this very systematically yet, but it is often a lot faster for polynomials of high degree. Here is an example:

build/examples/poly_roots a 400 b 50 t 30 c 123
old: 89 s
new: 4.1 s

There are some minor speed ups for the test suite (test multiplier 10):

make check MOD=qqbar
old: 30.0 s
new: 27.0 s

build/acb_poly/test/main acb_poly_find_roots
old: 0.60 s
new: 0.43 s

make check MOD=arb_fmpz_poly
old: 2.73 s
new: 2.40 s