cdawson, dawson - Dawson's integral
#include <cerf.h>
double complex cdawson ( double complex z );
double dawson ( double x );
The data type double complex is defined in the header <complex.h>, which C99 introduced. Since C11 it is optional: an implementation may define __STDC_NO_COMPLEX__ and then provide neither the header nor the type, and Microsoft's C compiler does not support the arithmetic operators for it. As a fallback, use the C++ variant of this library, libcerfcpp, in which double complex is replaced by std::complex<double> from the header <complex>.
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).
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).
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.
The computation of D(z) is based on Faddeeva's function w_of_z(3); to compute D(x), the imaginary part im_w_of_x(3) is used.
Other complex error functions: w_of_z(3), voigt(3), cerf(3), erfcx(3), erfi(3).
Homepage: https://jugit.fz-juelich.de/mlz/lib/cerf
Steven G. Johnson, Massachusetts Institute of Technology, wrote this function as part of the MIT Faddeeva package.
Joachim Wuttke, Forschungszentrum Juelich, reorganized the code into a library, and wrote this man page.
Please report bugs to the maintainer:
Joachim Wuttke <j.wuttke@fz-juelich.de>
Copyright (c) 2012 Massachusetts Institute of Technology
Copyright (c) 2013 Forschungszentrum Juelich GmbH
Software: MIT License.
This documentation: Creative Commons Attribution Share Alike.