FZERO(3)

SYNOPSIS
SUBROUTINE FZERO (F, B, C, R, RE, AE, IFLAG)

NAME
fzero - Search for a zero of a function F(X) in a given interval (B,C). It is designed primarily for problems where F(B) and F(C) have opposite signs.

LIBRARY
SLATEC

CATEGORY
F1B

TYPE
SINGLE PRECISION (FZERO-S, DFZERO-D)

KEYWORDS
BISECTION, NONLINEAR EQUATIONS, ROOTS, ZEROS

AUTHOR
Shampine, L. F., (SNLA) Watts, H. A., (SNLA)

DESCRIPTION
FZERO searches for a zero of a REAL function F(X) between the given REAL values B and C until the width of the interval (B,C) has collapsed to within a tolerance specified by the stopping criterion, ABS(B-C) .LE. 2.*(RW*ABS(B)+AE). The method used is an efficient combination of bisection and the secant rule and is due to T. J. Dekker. Description Of Arguments F :EXT - Name of the REAL external function. This name must be in an EXTERNAL statement in the calling program. F must be a function of one REAL argument. B :INOUT - One end of the REAL interval (B,C). The value returned for B usually is the better approximation to a zero of F. C :INOUT - The other end of the REAL interval (B,C) R :OUT - A (better) REAL guess of a zero of F which could help in speeding up convergence. If F(B) and F(R) have opposite signs, a root will be found in the interval (B,R); if not, but F(R) and F(C) have opposite signs, a root will be found in the interval (R,C); otherwise, the interval (B,C) will be searched for a possible root. When no better guess is known, it is recommended that r be set to B or C, since if R is not interior to the interval (B,C), it will be ignored. RE :IN - Relative error used for RW in the stopping criterion. If the requested RE is less than machine precision, then RW is set to approximately machine precision. AE :IN - Absolute error used in the stopping criterion. If the given interval (B,C) contains the origin, then a nonzero value should be chosen for AE. IFLAG :OUT - A status code. User must check IFLAG after each call. Control returns to the user from FZERO in all cases. 1 B is within the requested tolerance of a zero. The interval (B,C) collapsed to the requested tolerance, the function changes sign in (B,C), and F(X) decreased in magnitude as (B,C) collapsed. 2 F(B) = 0. However, the interval (B,C) may not have collapsed to the requested tolerance. 3 B may be near a singular point of F(X). The interval (B,C) collapsed to the requested tol- erance and the function changes sign in (B,C), but F(X) increased in magnitude as (B,C) collapsed, i.e. ABS(F(B out)) .GT. MAX(ABS(F(B in)),ABS(F(C in))) 4 No change in sign of F(X) was found although the interval (B,C) collapsed to the requested tolerance. The user must examine this case and decide whether B is near a local minimum of F(X), or B is near a zero of even multiplicity, or neither of these. 5 Too many (.GT. 500) function evaluations used.

REFERENCES
L. F. Shampine and H. A. Watts, FZERO, a root-solving code, Report SC-TM-70-631, Sandia Laboratories, September 1970. T. J. Dekker, Finding a zero by means of successive linear interpolation, Constructive Aspects of the Fundamental Theorem of Algebra, edited by B. Dejon and P. Henrici, Wiley-Interscience, 1969.

ROUTINES CALLED
R1MACH

REVISION HISTORY (YYMMDD)
700901 DATE WRITTEN
890531 Changed all specific intrinsics to generic. (WRB)
890531 REVISION DATE from Version 3.2
891214 Prologue converted to Version 4.0 format. (BAB)
920501 Reformatted the REFERENCES section. (WRB)