integrateDEO

Calculate the integral of an oscillating function f(x) over the infinite interval (a,$(INFTY)) using double exponential integration.

f(x) is assumed to take the form

f(x) = g(x) * sin(omega * x + theta)

as x goes to infinity (theta is not specified).

Result!Real
integrateDEO
(
Func
Real
)
(
scope Func f
,
Real a
,
Real omega
,
Real epsRel = cast(Real)1e-6
)

Examples

real f(real x) { return x <= 0 ? 0 : cos(x) * exp(-x/64) / sqrt(x); }
auto i = integrateDEO(&f, 0.0L, 1.0L, 1e-18L);

Meta