Function integrateQAWF

Calculates a Fourier transform integral.

Result!Real integrateQAWF(Func, Real) (
  scope Func f,
  Real a,
  Real omega,
  Oscillation weight,
  Real epsAbs
);

Use this to calculate the integral of f(x)*cos(omega*x) or f(x)*sin(omega*x) on the interval (a,∞). The weight function is specified by setting weight to Oscillation.cos or Oscillation.sin.

The procedure of integrateQAWO() is applied on successive finite intervals, and convergence acceleration by means of the Epsilon algorithm is applied to the series of integral approximations.

Note

This function is unique among the QUADPACK integrators in that you must specify an absolute accuracy, not a relative one.

See Also

integrateQAWO(), for similar integrals over a finite interval.

Example

// Calculate the integral of cos(x)*exp(-x/64)/sqrt(x) over
// the interval (0, infinity).
real f(real x) { return x <= 0 ? 0 : exp(-x/64) / sqrt(x); }
auto i = integrateQAWF(&f, 0.0L, 1.0L, Oscillation.cos, 1e-15L);