Author(s): K.S. Kölbig | Library: MATHLIB |
Submitter: | Submitted: 15.02.1989 |
Language: Fortran | Revised: 01.12.1994 |
Subroutine subprograms RDERIV and DDERIV compute an approximate numerical value of the derivative f'(x) of a function f(x) at a specified point x.
On computers other than CDC and Cray, only the double-precision version DDERIV is available. On CDC and Cray computers, only the single-precision version RDERIV is available.
Structure:
SUBROUTINE subprograms
User Entry Names : RDERIV, DDERIV
Obsolete User Entry Names: DERIV RDERIV
Files Referenced : Unit 6
External References: MTLMTR, ABEND,
user-supplied FUNCTION subprogram
Usage:
For (type REAL), (type DOUBLE PRECISION),
CALL tDERIV(F,X,DELTA,DFDX,RERR)
Method:
The method is based on an extension to numerical differentiation of Romberg's principle of sequence extrapolation, originally developed for numerical integration. The subroutine starts by computing the 10 numbers
with
where the scaling factor is initially set to DELTA. This procedure is repeated up to 9 times, with replaced by each time, until the sequence is found to be monotone. A Romberg-like triangular table
with appropriate weights is then computed for and DFDX is set equal to .
Restrictions:
The function f(x) must be differentiable at and in a neighbourhood of X. Misleading results will be obtained if this is not true.
Error handling:
Error D401.1: If the function f(x) is such that, after 9 successive reductions of by a factor 1/10, the sequence is not monotone, an error message is written Unit 6, unless subroutine MTLSET (N002) has been called. DFDX is set equal to zero, RERR is set equal to one in this case.
References: