.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Required to disable full justification in groff 1.23.0. .if n .ds AD l .\" ======================================================================== .\" .IX Title "build::libcerf::src::libcerf::man::dawson 3" .TH build::libcerf::src::libcerf::man::dawson 3 2026-09-05 "perl v5.42.2" "libcerf manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME cdawson, dawson \- Dawson\*(Aqs integral .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fB#include .PP \&\fBdouble complex cdawson ( double complex z );\fR .PP \&\fBdouble dawson ( double x );\fR .PP The data type \fBdouble complex\fR is defined in the header , 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\*(Aqs C compiler does not support the arithmetic operators for it. As a fallback, use the C++ variant of this library, libcerfcpp, in which \fBdouble complex\fR is replaced by \&\fBstd::complex\fR from the header . .SH DESCRIPTION .IX Header "DESCRIPTION" The function \fBcdawson\fR returns Dawson\*(Aqs integral D(z) = exp(\-z^2) integral from 0 to z exp(t^2) dt = sqrt(pi)/2 * exp(\-z^2) * erfi(z). .PP For function \fBdawson\fR takes a real argument x, and returns the real result D(x). .SH ACCURACY .IX Header "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. .PP \&\fBdawson\fR(x) = sqrt(pi)/2 Im w(x) inherits the accuracy of \fBim_w_of_x\fR(3): its relative error was found below 2.7 eps at random points with |x| up to 1e12. .PP \&\fBcdawson\fR is computed from \fBw_of_z\fR(3) as D(z) = \-i sqrt(pi)/2 (w(z) \- exp(\-z^2)), and the exponent \-z^2 = (y\-x)(x+y) \- 2ixy is carried as an unevaluated sum of two doubles, so that the factor is obtained to about 4 eps whatever |z| (Wuttke, see REFERENCES). At 20000 random points where the exponential neither over\- nor underflows, |z| reaching 1e8, the relative error of the modulus stays below 6.9 eps. Before libcerf\-3.7 the exponent was rounded into a single double, and the error grew in proportion to |z|^2, reaching 1080 eps at |z| = 26 and leaving no correct digit at all where x^2\-y^2 stays small up to |z| = 1e8. One further improvement is available and not yet implemented: in the sector about the real axis where exp(\-z^2) is negligible against w(z), evaluating the two terms separately, which leaves 7.5 eps for the modulus and 7.8 eps for the components. .PP Close to the real axis and inside |z| < 7, \fBcdawson\fR inherits the expansion that \fBw_of_z\fR(3) uses for Re w there, and its relative error is correspondingly smaller: cdawson(\-5, 0.00051), for instance, falls from 1300 to 0.1 eps. Near the zeros of D(z), which are those of erfi, the first of which lie at z = +\-1.8809 +\- 1.4506i, cancellation amplifies the relative error without bound. Close to the origin, for 0.005 < |z| < 0.1 off the coordinate axes, where the Maclaurin series is not used, up to about 320 eps were found. .SH REFERENCES .IX Header "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. .SH "SEE ALSO" .IX Header "SEE ALSO" The computation of D(z) is based on Faddeeva\*(Aqs function \fBw_of_z\fR(3); to compute D(x), the imaginary part \fBim_w_of_x\fR(3) is used. .PP Other complex error functions: \fBw_of_z\fR(3), \fBvoigt\fR(3), \fBcerf\fR(3), \fBerfcx\fR(3), \fBerfi\fR(3). .PP Homepage: https://jugit.fz\-juelich.de/mlz/lib/cerf .SH AUTHORS .IX Header "AUTHORS" Steven G. Johnson, Massachusetts Institute of Technology, wrote this function as part of the MIT Faddeeva package. .PP Joachim Wuttke, Forschungszentrum Juelich, reorganized the code into a library, and wrote this man page. .SH CONTACT .IX Header "CONTACT" Please report bugs to the maintainer: .PP Joachim Wuttke .SH COPYING .IX Header "COPYING" Copyright (c) 2012 Massachusetts Institute of Technology .PP Copyright (c) 2013 Forschungszentrum Juelich GmbH .PP Software: MIT License. .PP This documentation: Creative Commons Attribution Share Alike.