.\" -*- 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::voigt 3" .TH build::libcerf::src::libcerf::man::voigt 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 voigt \- Voigt\*(Aqs function, convolution of Gaussian and Lorentzian .SH SYNOPSIS .IX Header "SYNOPSIS" \&\fB#include .PP \&\fBdouble voigt ( double x, double sigma, double gamma );\fR .SH DESCRIPTION .IX Header "DESCRIPTION" The function \fBvoigt\fR returns Voigt\*(Aqs convolution .PP .Vb 1 \& voigt(x,sigma,gamma) = integral G(t,sigma) L(x\-t,gamma) dt .Ve .PP of a Gaussian .PP .Vb 1 \& G(x,sigma) = 1/sqrt(2*pi)/|sigma| * exp(\-x^2/2/sigma^2) .Ve .PP and a Lorentzian .PP .Vb 1 \& L(x,gamma) = |gamma| / pi / ( x^2 + gamma^2 ), .Ve .PP with the integral extending from \-infinity to +infinity. .PP If sigma=0, L(x,gamma) is returned. Conversely, if gamma=0, G(x,sigma) is returned. .PP If sigma=gamma=0, the return value is Inf for x=0, and 0 for all other x. It is advisable to test input arguments to exclude this irregular case. .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. .PP \&\fBvoigt\fR is computed as Re w(z) / (sqrt(2 pi) sigma) from \fBw_of_z\fR(3), which controls the relative error of the modulus |w|, but not of its real part separately. Around the line center, both are of the same order, and the relative error of \fBvoigt\fR was found below 7 eps for |x| < 2 sigma and below 16 eps for |x| < 3 sigma, for gamma between 1e\-10 and 1e3 sigma. .PP In the wings, |x| >> sigma, the Lorentzian tail dominates, and Re w is smaller than |w| by a factor of about gamma/|x|; the relative error of \&\fBvoigt\fR grows by the inverse factor. For |x| < 10 sigma, where \fBw_of_z\fR computes Re w from an expansion about the real axis, the loss is bounded by that of the expansion, a few eps: 0.4 eps were found at x = 7.5 sigma, gamma = 1e\-8 sigma, where before that expansion was introduced the error reached 7e8 eps, a relative error of 8e\-8. For |x| > 10 sigma, where the asymptotic expansion of w is used, up to 1.5e4 eps at x = 10 sigma, and below 6 eps for 15 sigma < |x| < 100 sigma. For gamma < 1e\-9 |x|, w is obtained from a first\-order expansion around the real axis, and the relative error of \fBvoigt\fR is about 2.5 (x/sigma)^2 eps. .PP What remains is not inherent in the problem. The profile is nowhere smaller than gamma / (pi (x^2 + gamma^2 + sigma^2)), a proven lower bound, so that a componentwise error bound for Re w would carry over to \fBvoigt\fR and would hold at about 12 eps over the whole parameter range. What is needed for that is set out in the manuscript cited below. .SH REFERENCES .IX Header "REFERENCES" Formula (7.4.13) in Abramowitz & Stegun (1964) relates Voigt\*(Aqs convolution integral to Faddeeva\*(Aqs function \fBw_of_z\fR, upon which this implementation is based: .PP .Vb 1 \& voigt(x,sigma,gamma) = Re[w(z)] / sqrt(2*pi) / |sigma| .Ve .PP with .PP .Vb 1 \& z = (x+i*|gamma|) / sqrt(2) / |sigma|. .Ve .PP 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" \&\fBvoigt_hwhm\|(3)\fR .PP Related complex error functions: \&\fBw_of_z\|(3)\fR, \fBdawson\|(3)\fR, \fBcerf\|(3)\fR, \fBerfcx\|(3)\fR, \fBerfi\|(3)\fR. .PP Homepage: https://jugit.fz\-juelich.de/mlz/lib/cerf .SH AUTHOR .IX Header "AUTHOR" Joachim Wuttke, Forschungszentrum Juelich. .SH CONTACT .IX Header "CONTACT" Please report bugs to the maintainer: .PP Joachim Wuttke .SH COPYING .IX Header "COPYING" Copyright (c) 2013\-2025 Forschungszentrum Juelich GmbH .PP Software: MIT License. .PP This documentation: Creative Commons Attribution Share Alike.