Doxygen Source Code Documentation
cdf_42.c
Go to the documentation of this file.00001 #include "cdflib.h" 00002 void dstinv(double *zsmall,double *zbig,double *zabsst, 00003 double *zrelst,double *zstpmu,double *zabsto, 00004 double *zrelto) 00005 /* 00006 ********************************************************************** 00007 void dstinv(double *zsmall,double *zbig,double *zabsst, 00008 double *zrelst,double *zstpmu,double *zabsto, 00009 double *zrelto) 00010 00011 Double Precision - SeT INverse finder - Reverse Communication 00012 Function 00013 Concise Description - Given a monotone function F finds X 00014 such that F(X) = Y. Uses Reverse communication -- see invr. 00015 This routine sets quantities needed by INVR. 00016 More Precise Description of INVR - 00017 F must be a monotone function, the results of QMFINV are 00018 otherwise undefined. QINCR must be .TRUE. if F is non- 00019 decreasing and .FALSE. if F is non-increasing. 00020 QMFINV will return .TRUE. if and only if F(SMALL) and 00021 F(BIG) bracket Y, i. e., 00022 QINCR is .TRUE. and F(SMALL).LE.Y.LE.F(BIG) or 00023 QINCR is .FALSE. and F(BIG).LE.Y.LE.F(SMALL) 00024 if QMFINV returns .TRUE., then the X returned satisfies 00025 the following condition. let 00026 TOL(X) = MAX(ABSTOL,RELTOL*ABS(X)) 00027 then if QINCR is .TRUE., 00028 F(X-TOL(X)) .LE. Y .LE. F(X+TOL(X)) 00029 and if QINCR is .FALSE. 00030 F(X-TOL(X)) .GE. Y .GE. F(X+TOL(X)) 00031 Arguments 00032 SMALL --> The left endpoint of the interval to be 00033 searched for a solution. 00034 SMALL is DOUBLE PRECISION 00035 BIG --> The right endpoint of the interval to be 00036 searched for a solution. 00037 BIG is DOUBLE PRECISION 00038 ABSSTP, RELSTP --> The initial step size in the search 00039 is MAX(ABSSTP,RELSTP*ABS(X)). See algorithm. 00040 ABSSTP is DOUBLE PRECISION 00041 RELSTP is DOUBLE PRECISION 00042 STPMUL --> When a step doesn't bound the zero, the step 00043 size is multiplied by STPMUL and another step 00044 taken. A popular value is 2.0 00045 DOUBLE PRECISION STPMUL 00046 ABSTOL, RELTOL --> Two numbers that determine the accuracy 00047 of the solution. See function for a precise definition. 00048 ABSTOL is DOUBLE PRECISION 00049 RELTOL is DOUBLE PRECISION 00050 Method 00051 Compares F(X) with Y for the input value of X then uses QINCR 00052 to determine whether to step left or right to bound the 00053 desired x. the initial step size is 00054 MAX(ABSSTP,RELSTP*ABS(S)) for the input value of X. 00055 Iteratively steps right or left until it bounds X. 00056 At each step which doesn't bound X, the step size is doubled. 00057 The routine is careful never to step beyond SMALL or BIG. If 00058 it hasn't bounded X at SMALL or BIG, QMFINV returns .FALSE. 00059 after setting QLEFT and QHI. 00060 If X is successfully bounded then Algorithm R of the paper 00061 'Two Efficient Algorithms with Guaranteed Convergence for 00062 Finding a Zero of a Function' by J. C. P. Bus and 00063 T. J. Dekker in ACM Transactions on Mathematical 00064 Software, Volume 1, No. 4 page 330 (DEC. '75) is employed 00065 to find the zero of the function F(X)-Y. This is routine 00066 QRZERO. 00067 ********************************************************************** 00068 */ 00069 { 00070 E0000(1,NULL,NULL,NULL,NULL,NULL,zabsst,zabsto,zbig,zrelst,zrelto,zsmall, 00071 zstpmu); 00072 } /* END */