Next: C201 Numerical Solution
Up: CERNLIB
Previous: B300 An integral
Routine ID: C200
| Author(s): K.S. Kölbig | Library: MATHLIB
|
Submitter: | Submitted: 01.05.1990
|
Language: Fortran | Revised: 01.12.1994
|
Function subprograms RZEROX and DZEROX compute, to an
attempted specified accuracy, a zero
of a real-valued
function
lying in a given interval
,
where
.
On computers other than CDC or Cray, only the double precision
version DZEROX is available.
On CDC and Cray computers, only the single-precision version
RZEROX is available.
Structure:
FUNCTION subprograms
User Entry Names: RZEROX, DZEROX
Obsolete User Entry Names: ZEROX
RZEROX
Files Referenced: Unit 6
External References: User-supplied FUNCTION subprogram
Usage:
For
(type REAL),
(type
DOUBLE PRECISION),
tZEROX(A,B,EPS,MAXF,F,MODE)
has, in any arithmetic expression, the value
.
- A,B
- (type according to t) On entry, A and B
must specify the end points of the search interval. Unchanged on exit.
- EPS
- (type according to t)
On entry, EPS must be equal to the accuracy parameter
(see Accuracy). Unchanged on exit.
- MAXF
- ( INTEGER)
On entry, MAXF must be equal to the maximum permitted
number of references to the function F within the iteration loop.
Unchanged on exit.
- F
- (type according to t) Name of a user-supplied
FUNCTION subprogram, declared EXTERNAL in the calling
program. This subprogram must set
.
- MODE
- ( INTEGER)
On entry,
or
defines the
algorithm for finding
(see Method and Notes).
Method:
Two algorithims are incorporated in this subprogram. These are
described in Ref. 1 as ``Algorithm M'' (
) and
``Algorithm R'' (
). Both are mixtures of linear
interpolation, rational interpolation and bisection.
Accuracy:
These subprograms try to compute two numbers
and
lying in the interval
such that
-
-
-
If successful, the value of
is assigned to the function name.
Notes:
-
should be used for fairly simple functions whose
evaluation is cheap in comparison with the calculations performed in
one iteration step of RZEROX or DZEROX.
-
should be used for more expensive functions.
Convergence should be faster than for
, but the
evaluation steps are more expensive.
- For functions which have a pole near the exact zero,
is recommended because of the special character of
the interpolation formula which is used.
Error handling:
-
.
The function value is set equal to zero.
- MODE has a value other than 1 or 2.
The function value is set equal to zero.
- The number of references to F exceeds MAXF.
The function value is set equal to the last computed value of
(see Accuracy)
For each error a message is printed.
The subprogram is based on Algol programs described in Ref. 1.
References:
- J.C.P. Bus and T.J. Dekker, Two efficient algorithms with
garanteed convergence for finding a zero of a function,
ACM Trans. Math. Software 1 (1975) 330--345.
C201
J.J. Moré, M.Y. Cosnard
Next: C201 Numerical Solution
Up: CERNLIB
Previous: B300 An integral
Janne Saarela
Mon Apr 3 15:06:23 METDST 1995