zerosPolyComplex

Finds the zeros of a polynomial with complex coefficients using the Jenkins-Traub, three-stage algorithm.

Synopsis

zerosPolyComplex (coef)

Required Arguments

complex coef[] (Input)

Array with ndeg + 1 components containing the coefficients of the polynomial in increasing order by degree. The degree of the polynomial is

\[\texttt{coef} [n] z^n + \texttt{coef} [n − 1] z^{n-1} + \ldots + \texttt{coef} [0]\]

where n = ndeg.

Return Value

The complex array of zeros of the polynomial. If no zeros are computed, then None is returned.

Description

The function zerosPolyComplex computes the n zeros of the polynomial

\[p(z) = a_nz^n + a_{n-1} z^{n-1} + \ldots + a_1z + a_0\]

where the coefficients \(a_i\) for \(i=0,1,\ldots,n\) are complex and n is the degree of the polynomial.

The function zerosPolyComplex uses the Jenkins-Traub, three-stage complex algorithm (Jenkins and Traub 1970, 1972). The zeros are computed one at a time in roughly increasing order of modulus. As each zero is found, the polynomial is deflated to one of lower degree.

Example

This example finds the zeros of the third-degree polynomial

\[p(z) = z^3 − (3 + 6i) z^2 − (8 − 12i) z + 10\]

where z is a complex variable.

from numpy import *
from pyimsl.math.zerosPolyComplex import zerosPolyComplex
from pyimsl.math.writeMatrixComplex import writeMatrixComplex

coeff = array((complex(10, 0),
               complex(-8, 12),
               complex(-3, -6),
               complex(1, 0)))

zeros = zerosPolyComplex(coeff)
writeMatrixComplex("The complex zeros found are", zeros)

Output

 
             The complex zeros found are
                        1                          2
(          1,          1)  (          1,          2)
 
                        3
(          1,          3)

Warning Errors

IMSL_ZERO_COEFF The first several coefficients of the polynomial are equal to zero. Several of the last roots will be set to machine infinity to compensate for this problem.
IMSL_FEWER_ZEROS_FOUND Fewer than ndeg zeros were found. The root vector will contain the value for machine infinity in the locations that do not contain zeros.