polyroot(z)
z
| the vector of polynomial coefficients in decreasing order. |
p(x) = z1 + z2 * x + ... + z[n] * x^(n-1)
is given by its coefficient vectorz[1:n]
.
polyroot
returns the n-1 complex zeros of p(x)
using the Jenkins-Traub algorithm.length(z)
.uniroot
for numerical root finding of arbitrary
functions;
complex
and the zero
example in the demos
directory.polyroot(c(1, 2, 1)) round(polyroot(choose(8, 0:8)), 11) # guess what! for (n1 in 1:4) print(polyroot(1:n1), digits = 4)