POLYROOT (vector);
The POLYROOT function computes the zeros of a real polynomial. The vector argument is an (or ) vector that contains the coefficients of an () degree polynomial with the coefficients arranged in order of decreasing powers.
The POLYROOT function returns the array r, which is an matrix that contains the roots of the polynomial. The first column of r contains the real part of the complex roots, and the second column contains the imaginary part. If a root is real, the imaginary part is 0.
The POLYROOT function finds the real and complex roots of a polynomial with real coefficients.
The POLYROOT function uses an algorithm proposed by Jenkins and Traub (1970) to find the roots of the polynomial. The algorithm is not guaranteed to find all roots of the polynomial. An appropriate warning message is issued when one or more roots cannot be found. If r is given as a root of the polynomial , then , based on the rounding error of the computer that is employed.
For example, you can use the following statements to find the roots of the polynomial
p = {0.2567 0.1570 0.0821 -0.3357 1}; r = polyroot(p); print r;
Figure 25.276: Roots of a Quartic Polynomial
The polynomial has two conjugate pairs of roots that, within machine precision, are given by and .