
polyroot(z)
z
.z[1:n]
.
polyroot
returns the z
has zeroes for the highest powers,
these are discarded. There is no maximum degree, but numerical stability
may be an issue for all but low-degree polynomials.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)
polyroot(c(1, 2, 1, 0, 0)) # same as the first
Run the code above in your browser using DataLab