Find zeros of a real or complex polynomial.
the vector of polynomial coefficients in increasing order.
A polynomial of degree n - 1,
p(x) = z1 + z2 * x + … + z[n] * x^(n-1)
is given by its coefficient vector
polyroot returns the n-1 complex zeros of p(x)
using the Jenkins-Traub algorithm.
If the coefficient vector
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.
A complex vector of length n - 1, where n is the position
of the largest non-zero element of
C translation by Ross Ihaka of Fortran code in the reference, with modifications by the R Core Team.
Jenkins and Traub (1972) TOMS Algorithm 419. Comm. ACM, 15, 97–99.
uniroot for numerical root finding of arbitrary
complex and the
zero example in the demos
1 2 3 4
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.