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

◆ deoint()

void deoint ( double(*)(double)  f,
double  a,
double  omega,
int  iflag,
double  eps,
double *  result,
int *  neval,
double *  err,
int *  info 
)

Semi-infinite interval automatic quadrature for Fourier integrals (double exponential (DE) formula)

Purpose
This routine computes the following Fourier integrals by the automatic integration applying the double exponential (DE) formula.
Ic = ∫ f(x) cosωx dx [a, +∞] or Is = ∫ f(x) sinωx dx [a, +∞]
where f(x) is a given function defined by a user supplied subroutine f.

Ic or Is is transformed to the intergral on the infinite interval [-∞, +∞] by using the following transformation function, and the integral value is computed by the trapezoidal rule.
Ic: x = Mφ(t - π/2M)/ω
Is: x = Mφ(t)/ω
The following φ(t) is used.
φ1(t) = t/(1 - exp(-2t -α(1 - exp(-t)) - β(exp(t) - 1))),
β = 1/4, α = β/sqrt(1 + Mlog(1 + M)/4π)
or
φ2(t) = t/(1 - exp(-ksinh(t))), k = 2π
The step size h and the constant M are selected to satisfy Mh = π.
Please refer to the reference below for more details.
Parameters
[in]fThe user supplied subroutine which calculates the integrand function f(x) defined as follows.
double f(double x)
{
return computed f(x) value
}
[in]aLower bound of integration interval.
[in]omegaω value in cos or sin.
[in]iflagChoose the type of integral.
= 0: ∫ f(x) cosωx dx [0, +∞]
= 1: ∫ f(x) sinωx dx [0, +∞]
Further, the transformation function can be selected as follows.
iflag += 0: φ1(t) (recommended)
iflag += 2: φ2(t)
[in]epsRelative accuracy requested. (0 < eps <= 1)
[out]resultObtained approximation to the integral.
[out]nevalNumber of evaluations of f(x).
[out]errEstimated relative error of obtained v.
To be overestimated for many cases. This routine may return as successful exit even if err > eps.
[out]info= 0: Successful exit
= -4: The argument iflag had an illegal value (iflag != 0 to 3)
= -5: The argument eps had an illegal value (eps <= 0 or eps > 1)
= 1: Not converged
Reference
  • Ooura and Mori, "The double exponential formula for oscillatory functions over the half infinite interval", J. Comput. Appl. Math., 38 (1991), 353-360.
  • Ooura and Mori, "A robust double exponential formula for Fourier-type integrals", J. Comput. Appl. Math., 112 (1999), 229-241.