Finds the zeros of a polynomial with real coefficients using the Jenkins-Traub three-stage algorithm.
COEFF — Vector of
length NDEG + 1 containing
the coefficients of the polynomial in increasing order by degree.
(Input)
The polynomial is
COEFF(NDEG + 1)*Z**NDEG + COEFF(NDEG) * Z**(NDEG -1) + … + COEFF(1).
ROOT — Complex vector of length NDEG containing the zeros of the polynomial. (Output)
NDEG — Degree of
the polynomial. 1 ≤ NDEG ≤
100 (Input)
Default: NDEG = size (COEFF,1) – 1.
Generic: CALL ZPORC (COEFF, ROOT [,…])
Specific: The specific interface names are S_ZPORC and D_ZPORC.
Single: CALL ZPORC (NDEG, COEFF, ROOT)
Double: The double precision name is DZPORC.
Routine ZPORC computes the n zeros of the polynomial
p(z) = anzn + an-1 zn-1 + … + a1z + a0
where the coefficients ai for i = 0, 1, …, n are real and n is the degree of the polynomial.
The routine ZPORC uses the Jenkins-Traub three-stage algorithm (Jenkins and Traub 1970; Jenkins 1975). The zeros are computed one at a time for real zeros or two at a time for complex conjugate pairs. As the zeros are found, the real zero or quadratic factor is removed by polynomial deflation.
3 1 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.
3 2 Fewer than NDEG zeros were found. The ROOT vector will contain the value for machine infinity in the locations that do not contain zeros.
This example finds the zeros of the third-degree polynomial
where z is a complex variable.
DATA COEFF/-2.0, 4.0, -3.0, 1.0/
CALL WRCRN ('The zeros found are', ZERO, 1, NDEG, 1)
The zeros found
are
1
2
3
( 1.000, 0.000) ( 1.000, 1.000) ( 1.000,-1.000)
Visual Numerics, Inc. PHONE: 713.784.3131 FAX:713.781.9260 |