XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ dehint_r()

void dehint_r ( double  a,
double  eps,
double *  result,
int *  neval,
int *  l,
int *  info,
double *  xx,
double  yy,
int *  irev 
)

Semi-infinite interval automatic quadrature (double exponential (DE) formula) (reverse communication version)

Purpose
This routine computes the integral of f(x) over [a, +∞], satisfying the requested accuracy. The integrand f(x) is computed and provided by the user in accordance with irev.
The result is obtained by the automatic integration applying the double exponential (DE) formula.

The double exponential (DE) formulas (see defint) for semi-infinite interval [0, +∞] is obtained by using the following transformation functions.
(1) φ(t) = exp(t/2 - exp(-t))
(2) φ(t) = exp(t - exp(-t))
(3) φ(t) = exp(2sinh(t))
(1) is suitable for the functions decaying very rapidly such as f(x) = f1(x)exp(-x^2). (2) is suitable for the functions with an exponential factor such as f(x) = f2(x)exp(-x). (3) is used for the slowly decaying rational or algebraic functions.
This routine will automatically choose one of the above three functions by examining the behavior of the integrand. The argument l returns which transformation function was used.
Parameters
[in]aLower limit of integration.
[in]epsAbsolute accuracy requested.
max(|eps|, 1.0e-32) is used as the tolerance.
[out]resultApproximation to integral of f(x) over [a, +inf].
[out]nevalNumber of integrand evaluations.
[out]lThe mapping function used to integrate.
= 0: x = exp(0.5*t-exp(-t))
= 1: x = exp(t-exp(-t))
= 2: x = exp(2*sinh(t))
[out]info= 0: Successful exit
= 1: Slow decay on negative side
= 2: Slow decay on positive side
= 3: Both of above
= 4: Insufficient mesh refinement
[out]xxirev = 1 to 5: xx contains the abscissa where the function value should be evaluated and given in the next call.
[in]yyirev = 1 to 5: The function value f(xx) should be given in yy in the next call.
[in,out]irevControl variable for reverse communication.
[in] Before first call, irev should be initialized to zero. On succeeding calls, irev should not be altered.
[out] If irev is not zero, complete the following tasks and call this routine again without changing irev.
= 0: Computation finished.
= 1 to 5: User should set the function value at xx in yy. Do not alter any variables other than yy.
Reference
Masatake Mori "FORTRAN77 Numerical Calculation Programming (augmented edition)" Iwanami Shoten, 1987. (Japanese book)