|
|
◆ dehint()
| void dehint |
( |
double(*)(double) |
f, |
|
|
double |
a, |
|
|
double |
eps, |
|
|
double * |
result, |
|
|
int * |
neval, |
|
|
int * |
l, |
|
|
int * |
info |
|
) |
| |
Semi-infinite interval automatic quadrature (double exponential (DE) formula)
- Purpose
- This routine computes the integral of f(x) over [a, +∞], satisfying the requested accuracy, where f(x) is a given function defined by a user supplied subroutine f.
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] | f | The user supplied subroutine which calculates the integrand function f(x) defined as follows. double f(double x)
{
return computed f(x) value
}
|
| [in] | a | Lower limit of integration. |
| [in] | eps | Absolute accuracy requested.
max(|eps|, 1.0e-32) is used as the tolerance. |
| [out] | result | Approximation to integral of f(x) over [a, +inf]. |
| [out] | neval | Number of integrand evaluations. |
| [out] | l | The 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 |
- Reference
- Masatake Mori "FORTRAN77 Numerical Calculation Programming (augmented edition)" Iwanami Shoten, 1987. (Japanese book)
|