cdawson3
Dawson's integral
Usage
double complex
cdawson
(
double
complex
z
);
double dawson
(
double
x
);
Overview
The function cdawson returns Dawson's integral D(z) = exp(-z^2) integral from 0 to z exp(t^2) dt = sqrt(pi)/2 * exp(-z^2) * erfi(z).
For function dawson takes a real argument x, and returns the real result D(x).
Accuracy
Errors are given in units of eps = 2^-53 = 1.1e-16, as relative deviations from high-precision reference values; for complex results, of the modulus.
dawson(x) = sqrt(pi)/2 Im w(x) inherits the accuracy of im_w_of_x(3): its relative error was found below 2.7 eps for |x| up to 1e12.
cdawson is computed from w_of_z(3) as D(z) = -i sqrt(pi)/2 (w(z) - exp(-z^2)), with the exponent -z^2 carried as an unevaluated sum of two doubles. The two terms may cancel, and the error is not controlled; near the zeros of D(z), which are those of erfi, the first of which lie at z = +-1.8809 +- 1.4506i, the relative error is unbounded, and close to the origin, for 0.005 < |z| < 0.1 off the coordinate axes, where the Maclaurin series is not used, it reaches about 320 eps. Close to the real axis and inside |z| < 7, cdawson profits from the expansion that w_of_z(3) uses for Re w there. An improvement is available and not yet implemented: evaluating the two terms separately in the sector about the real axis where exp(-z^2) is negligible against w(z).
References
Joachim Wuttke, "libcerf, complex error function and related functions reimplemented with relative accuracy guarantees" (unpublished manuscript, available upon request) documents the algorithms of this library and derives their error bounds.
Contact
Please report bugs to the maintainer:
Joachim Wuttke <[email protected]>
Copying
Copyright (c) 2012 Massachusetts Institute of Technology
Copyright (c) 2013 Forschungszentrum Juelich GmbH
Software: MIT License.
This documentation: Creative Commons Attribution Share Alike.
History
- Arch Linux 2026-11-01: the text shown here
- Debian 13 (Trixie)
- Debian 12 (Bookworm) to Debian 8 (Jessie)