EVOLUTION-MANAGER
Edit File: polyroot.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Find Zeros of a Real or Complex Polynomial</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for polyroot {base}"><tr><td>polyroot {base}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Find Zeros of a Real or Complex Polynomial</h2> <h3>Description</h3> <p>Find zeros of a real or complex polynomial. </p> <h3>Usage</h3> <pre> polyroot(z) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>z</code></td> <td> <p>the vector of polynomial coefficients in increasing order.</p> </td></tr> </table> <h3>Details</h3> <p>A polynomial of degree <i>n - 1</i>, </p> <p style="text-align: center;"><i> p(x) = z1 + z2 * x + … + z[n] * x^(n-1)</i></p> <p>is given by its coefficient vector <code>z[1:n]</code>. <code>polyroot</code> returns the <i>n-1</i> complex zeros of <i>p(x)</i> using the Jenkins-Traub algorithm. </p> <p>If the coefficient vector <code>z</code> has zeroes for the highest powers, these are discarded. </p> <p>There is no maximum degree, but numerical stability may be an issue for all but low-degree polynomials. </p> <h3>Value</h3> <p>A complex vector of length <i>n - 1</i>, where <i>n</i> is the position of the largest non-zero element of <code>z</code>. </p> <h3>Source</h3> <p>C translation by Ross Ihaka of Fortran code in the reference, with modifications by the R Core Team. </p> <h3>References</h3> <p>Jenkins, M. A. and Traub, J. F. (1972). Algorithm 419: zeros of a complex polynomial. <em>Communications of the ACM</em>, <b>15</b>(2), 97–99. doi: <a href="https://doi.org/10.1145/361254.361262">10.1145/361254.361262</a>. </p> <h3>See Also</h3> <p><code><a href="../../stats/html/uniroot.html">uniroot</a></code> for numerical root finding of arbitrary functions; <code><a href="complex.html">complex</a></code> and the <code>zero</code> example in the demos directory. </p> <h3>Examples</h3> <pre> 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 </pre> <hr /><div style="text-align: center;">[Package <em>base</em> version 3.6.0 <a href="00Index.html">Index</a>]</div> </body></html>