Bairstow's root finding method needs very good initial approximations for the quadratic factors in order to converge.
I tried various constants, random numbers, fractions out of the trailing coefficient (-a1/a2, -a0/a2; by Lin?) to no avail.
Please, does anyone know of a good method for choosing the factors?
For example:
1*x^8 + 118*x^7 + 1*x^6 + 2*x^5 - 2*x^4 - 3*x^3 + 3*x^2 + 2*x + 1
It take 3x as much time to find the root with the initial approximations 0.1, 0.2 than it does with 0.2, 2.0.
Or:
1*x^8 - 36*x^7 + 546*x^6 - 4536*x^5 + 22449*x^4 - 67284*x^3 + 118124*x^2 - 109584*x + 40320
takes slightly longer (~50%) with 0.1, 1.2 than with 0.1, 0.1
Trying to use Cauchy's bound for the initial quadratic approximation:
R=0
for i in range(1,n+1):
R=max(abs(a[i]/a[0]),R)
R=1+R
phi=2*pi*random()
x1=complex(R*cos(phi),R*sin(phi))
x2=complex(x1.real,-x1.imag)
r=-x1.real-x2.real
s=(x1*x2).real
Unfortunately, this does not really speed-up the converge.