c02anf attempts to find the roots of the quartic equation
where
$e$,
$a$,
$b$,
$c$ and
$d$ are complex coefficients with
$e\ne 0$. The roots are located by finding the eigenvalues of the associated
$4$ by
$4$ (upper Hessenberg) companion matrix
$H$ given by
The eigenvalues are obtained by a call to
f08psf (zhseqr). Further details can be found in
Section 9.
To obtain the roots of a cubic equation,
c02amf can be used.
 1: $\mathbf{e}$ – Complex (Kind=nag_wp)Input

On entry: $e$, the coefficient of ${z}^{4}$.
Constraint:
${\mathbf{e}}\ne \left(0.0,0.0\right)$.
 2: $\mathbf{a}$ – Complex (Kind=nag_wp)Input

On entry: $a$, the coefficient of ${z}^{3}$.
 3: $\mathbf{b}$ – Complex (Kind=nag_wp)Input

On entry: $b$, the coefficient of ${z}^{2}$.
 4: $\mathbf{c}$ – Complex (Kind=nag_wp)Input

On entry: $c$, the coefficient of $z$.
 5: $\mathbf{d}$ – Complex (Kind=nag_wp)Input

On entry: $d$, the constant coefficient.
 6: $\mathbf{zeror}\left(4\right)$ – Real (Kind=nag_wp) arrayOutput
 7: $\mathbf{zeroi}\left(4\right)$ – Real (Kind=nag_wp) arrayOutput

On exit: ${\mathbf{zeror}}\left(i\right)$ and ${\mathbf{zeroi}}\left(i\right)$ contain the real and imaginary parts, respectively, of the $i$th root.
 8: $\mathbf{errest}\left(4\right)$ – Real (Kind=nag_wp) arrayOutput

On exit: ${\mathbf{errest}}\left(i\right)$ contains an approximate error estimate for the $i$th root.
 9: $\mathbf{ifail}$ – IntegerInput/Output

On entry:
ifail must be set to
$0$,
$1\text{ or}1$. If you are unfamiliar with this argument you should refer to
Section 3.4 in How to Use the NAG Library and its Documentation for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value
$1\text{ or}1$ is recommended. If the output of error messages is undesirable, then the value
$1$ is recommended. Otherwise, if you are not familiar with this argument, the recommended value is
$0$.
When the value $\mathbf{1}\text{ or}\mathbf{1}$ is used it is essential to test the value of ifail on exit.
On exit:
${\mathbf{ifail}}={\mathbf{0}}$ unless the routine detects an error or a warning has been flagged (see
Section 6).
If on entry
${\mathbf{ifail}}=0$ or
$1$, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Please consult the
X06 Chapter Introduction for information on how to control and interrogate the OpenMP environment used within this routine. Please also consult the
Users' Note for your implementation for any additional implementationspecific information.
The method used by the routine consists of the following steps, which are performed by routines from LAPACK in
Chapter F08.
(a) 
Form matrix $H$. 
(b) 
Apply a diagonal similarity transformation to $H$ (to give ${H}^{\prime}$). 
(c) 
Calculate the eigenvalues and Schur factorization of ${H}^{\prime}$. 
(d) 
Calculate the left and right eigenvectors of ${H}^{\prime}$. 
(e) 
Estimate reciprocal condition numbers for all the eigenvalues of ${H}^{\prime}$. 
(f) 
Calculate approximate error estimates for all the eigenvalues of ${H}^{\prime}$ (using the $1$norm). 
This example finds the roots of the quartic equation