C207: Roots of a Cubic Equation

Author(s): K.S. Kölbig Library: MATHLIB
Submitter: Submitted: 15.01.1988
Language: Fortran Revised: 01.12.1994

Subroutine subprograms RRTEQ3 and DRTEQ3 compute the three roots of

displaymath87

for real coefficients r, s, t.

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

Structure:

SUBROUTINE subprograms
User Entry Names: RRTEQ3, DRTEQ3
Obsolete User Entry Names: RTEQ3 tex2html_wrap_inline91 RRTEQ3

Usage:

For tex2html_wrap_inline93 (type REAL), tex2html_wrap_inline95 (type DOUBLE PRECISION),

    CALL tRTEQ3(R,S,T,X,D)
R,S,T
(type according to t) Coefficients r,s,t in (*).
X
(type according to t) One-dimensional array of length tex2html_wrap_inline101 . On exit, X is set as described below.
D
(type according to t) On exit, D is set to the value of the discriminant of (*):
tex2html_wrap_inline105 One real root X(1) and two complex conjugate roots tex2html_wrap_inline107 , tex2html_wrap_inline109 ;
tex2html_wrap_inline111 Three real roots X(1), X(2), X(3), where at least tex2html_wrap_inline113 ;
tex2html_wrap_inline115 Three distinct real roots X(1), X(2), X(3).

Method:

The classical method of Tartaglia-Vieta is used. In certain cases, the solutions are improved by Newton iteration.

Accuracy:

Depends on the coefficients r,s,t. The values of X(1), X(2), X(3) and of D may be inaccurate if |D| is very small, even in the case of ``exact'' coefficients.
tex2html_wrap_inline119


Michel Goossens Tue Jun 4 20:45:41 METDST 1996