---
name: "cdawson"
section: "3"
platform: "linux"
package: "libcerf"
version: "1:3.9-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/cdawson"
---

# cdawson(3)

Dawson's integral

## NAME

cdawson, dawson - Dawson's integral

## SYNOPSIS

**#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\>.

## DESCRIPTION

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)](/im_w_of_x/3.md): its relative error was found below 2.7 eps for \|x\| up to 1e12.

**cdawson** is computed from [**w\_of\_z**(3)](/w_of_z/3.md) 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)](/w_of_z/3.md) 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.

## SEE ALSO

The computation of D(z) is based on Faddeeva's function [**w\_of\_z**(3)](/w_of_z/3.md); to compute D(x), the imaginary part [**im\_w\_of\_x**(3)](/im_w_of_x/3.md) is used.

Other complex error functions: [**w\_of\_z**(3)](/w_of_z/3.md), [**voigt**(3)](/voigt/3.md), [**cerf**(3)](/cerf/3.md), [**erfcx**(3)](/erfcx/3.md), [**erfi**(3)](/erfi/3.md).

Homepage: https://jugit.fz-juelich.de/mlz/lib/cerf

## AUTHORS

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.

## CONTACT

Please report bugs to the maintainer:

Joachim Wuttke \<j.wuttke@fz-juelich.de\>

## COPYING

Copyright (c) 2012 Massachusetts Institute of Technology

Copyright (c) 2013 Forschungszentrum Juelich GmbH

Software: MIT License.

This documentation: Creative Commons Attribution Share Alike.
