# polyroot: Find Zeros of a Real or Complex Polynomial

 polyroot R Documentation

## Find Zeros of a Real or Complex Polynomial

### Description

Find zeros of a real or complex polynomial.

### Usage

```polyroot(z)
```

### Arguments

 `z` the vector of polynomial coefficients in increasing order.

### Details

A polynomial of degree n - 1,

p(x) = z1 + z2 * x + … + z[n] * x^(n-1)

is given by its coefficient vector `z[1:n]`. `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.

### Value

A complex vector of length n - 1, where n is the position of the largest non-zero element of `z`.

### Source

C translation by Ross Ihaka of Fortran code in the reference, with modifications by the R Core Team.

### References

Jenkins, M. A. and Traub, J. F. (1972). Algorithm 419: zeros of a complex polynomial. Communications of the ACM, 15(2), 97–99. \Sexpr[results=rd,stage=build]{tools:::Rd_expr_doi("10.1145/361254.361262")}.

`uniroot` for numerical root finding of arbitrary functions; `complex` and the `zero` example in the demos directory.
```polyroot(c(1, 2, 1))