next up previous index
Next: C209 Zeros of Up: CERNLIB Previous: C207 Roots of

C208 Roots of a Quartic Equation

Routine ID: C208
Author(s): K.S. KölbigLibrary: MATHLIB
Submitter: Submitted: 15.01.1988
Language: FortranRevised: 01.12.1994

Subroutine subprograms RRTEQ4 and DRTEQ4 compute the four roots of

x4+ ax3+ bx2+ cx + d = 0 (*)

for real coefficients a,b,c,d.

On computers other than CDC or Cray, only the double-precision version DRTEQ4 is available. On CDC and Cray computers, only the single-precision version RRTEQ4 is available.

Structure:

SUBROUTINE subprograms
User Entry Names: RRTEQ4, DRTEQ4
Obsolete User Entry Names: RTEQ4 RRTEQ4
External References: RRTEQ3, DRTEQ3 (C207)

Usage:

For t=R (type REAL), t=D (type DOUBLE PRECISION),

    CALL tRTEQ4(A,B,C,D,Z,DC,MT)
A,B,C,D
(type according to t) Coefficients a,b,c,d in (*) .
Z
( COMPLEX for t=R , COMPLEX*16 for t=D ) One-dimensional array of length ≥4 . On exit, Z contains the roots of (*) .
DC
(type according to t) On exit, DC is set to the value of the discriminant of the cubic resolvent of (*) .
MT
( INTEGER) On exit, MT specifies the type of the roots:
= 1: Four real roots in Z(1),...,Z(4) ;
= 2: Two pairs of complex conjugate roots, one pair in Z(1), Z(2), the other in Z(3), Z(4);
= 3: Two real roots in Z(1), Z(2), and one pair of complex conjugate roots in Z(3), Z(4).

Method:

The equation is solved by the classical procedure, i.e., by solving its cubic resolvent and by combining the square roots of these solutions appropriately.

Accuracy:

Depends on the coefficients a,b,c,d. The values of Z(1),...,Z(4) and of DC may be inaccurate if |DC| is very small. MT may be uncertain in such cases.

C209



next up previous index
Next: C209 Zeros of Up: CERNLIB Previous: C207 Roots of


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995