ZPORC
Finds the zeros of a polynomial with real coefficients using the Jenkins-Traub three-stage algorithm.
Required Arguments
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)
Optional Arguments
NDEG — Degree of the polynomial. 1  NDEG  100 (Input)
Default: NDEG = size (COEFF,1) – 1.
FORTRAN 90 Interface
Generic: CALL ZPORC (COEFF, ROOT [])
Specific: The specific interface names are S_ZPORC and D_ZPORC.
FORTRAN 77 Interface
Single: CALL ZPORC (NDEG, COEFF, ROOT)
Double: The double precision name is DZPORC.
Description
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.
Comments
Informational errors
Type
Code
Description
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.
Example
This example finds the zeros of the third-degree polynomial
p(z) = z3 - 3z2 + 4z -2
where z is a complex variable.
 
USE ZPORC_INT
USE WRCRN_INT
 
IMPLICIT NONE
! Declare variables
INTEGER NDEG
PARAMETER (NDEG=3)
!
REAL COEFF(NDEG+1)
COMPLEX ZERO(NDEG)
! Set values of COEFF
! COEFF = (-2.0 4.0 -3.0 1.0)
!
DATA COEFF/-2.0, 4.0, -3.0, 1.0/
!
CALL ZPORC (COEFF, ZERO)
!
CALL WRCRN ('The zeros found are', ZERO, 1, NDEG, 1)
!
END
Output
 
The zeros found are
1 2 3
( 1.000, 0.000) ( 1.000, 1.000) ( 1.000,-1.000)
Published date: 03/19/2020
Last modified date: 03/19/2020