VOIGT(3)

πŸ’œ voigt(3) β€” libcerf manual, bestie edition

okay so this page lives in the libcerf manual, and honestly? she's kind of a big deal. sit down, grab a matcha, we're learning about voigt πŸ“


🌸 NAME 🌸

voigt β€” Voigt's function, aka the convolution of a Gaussian and a Lorentzian. two iconic curves, one slay collab πŸ’…


✨ SYNOPSIS ✨

#include <cerf.h>

double voigt ( double x, double sigma, double gamma );

that's it. three doubles in, one double out. no cap. 🫢


πŸŽ€ DESCRIPTION πŸŽ€

bestie. listen. voigt returns Voigt's convolution:

voigt(x,sigma,gamma) = integral G(t,sigma) L(x-t,gamma) dt

so we're convolving a Gaussian:

G(x,sigma) = 1/sqrt(2*pi)/|sigma| * exp(-x^2/2/sigma^2)

with a Lorentzian:

L(x,gamma) = |gamma| / pi / ( x^2 + gamma^2 ),

and the integral is extending from -infinity to +infinity. the whole entire line. main character integral energy πŸ”₯

now for the edge cases, because there are ALWAYS edge cases:

  • if sigma=0, then L(x,gamma) is what gets returned. bye Gaussian πŸ‘‹
  • conversely (love that word), if gamma=0, then G(x,sigma) is returned.
  • if sigma=gamma=0, the return value is Inf for x=0, and 0 for all other x. 😭
⚠️ lowkey important: it is advisable to test input arguments to exclude this irregular case. like, actually test them. don't just vibe and hope. the sigma=gamma=0 situation is not it πŸ’€

πŸ¦‹ REFERENCES πŸ¦‹

Formula (7.4.13) in Abramowitz & Stegun (1964) relates Voigt's convolution integral to Faddeeva's function w_of_z, upon which this implementation is based. iykyk πŸ“š

voigt(x,sigma,gamma) = Re[w(z)] / sqrt(2*pi) / |sigma|

with

z = (x+i*|gamma|) / sqrt(2) / |sigma|.

see? it's giving elegant. it's giving math girlie. ✨


🌈 SEE ALSO 🌈

Related complex error functions, aka the friend group:

Homepage: http://apps.jcns.fz-juelich.de/libcerf πŸ‘‘


πŸ’– AUTHORS πŸ’–

Joachim Wuttke <j.wuttke@fz-juelich.de>, Forschungszentrum Juelich β€” based on the w_of_z implementation by Steven G. Johnson, http://math.mit.edu/~stevenj, Massachusetts Institute of Technology.

Please report bugs to the authors. (fr fr, they want to know πŸ›)


🧚 COPYING 🧚

Copyright (c) 2013 Forschungszentrum Juelich GmbH

  • Software: MIT License.
  • This documentation: Creative Commons Attribution Share Alike.

okay that's the whole page, you ate that πŸ“πŸ’…

sign-off: this gem is from perl v5.42.2, dated 2026-02-15, and the page itself is home::buildoz...3::man::voigt(3) β€” go forth and convolve, bestie πŸ’œπŸ¦‹

πŸ“¦ where this page comes from