c02amf attempts to find the roots of the cubic equation
where
$u$,
$r$,
$s$ and
$t$ are complex coefficients with
$u\ne 0$. The roots are located by finding the eigenvalues of the associated
$3\times 3$ (upper Hessenberg) companion matrix
$H$ given by
The eigenvalues are obtained by a call to
f08psf. Further details can be found in
Section 9.
To obtain the roots of a quadratic equation,
c02ahf can be used.
If on entry
${\mathbf{ifail}}=0$ or
$\mathrm{1}$, explanatory error messages are output on the current error message unit (as defined by
x04aaf).
Background information to multithreading can be found in the
Multithreading documentation.
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).
Internal changes have been made to this routine as follows:
 At Mark 27.1: The algorithm used by this routine was adapted to make direct use of complex data.
For details of all known issues which have been reported for the NAG Library please refer to the
Known Issues.
This example finds the roots of the cubic equation