Skip to main content

fresnel

Function fresnel 

Source
pub fn fresnel(x: f64) -> (f64, f64)
Expand description

The Fresnel integrals $C(x) = \int_{0}^{x} \cos(\pi t^{2}/2), dt$ and $S(x) = \int_{0}^{x} \sin(\pi t^{2}/2), dt$, as (C, S), to about $10^{-15}$.

For $|x| < 1.5$ the power series $C + jS = \sum_{k} (j\pi/2)^{k} x^{2k+1} / (k!,(2k+1))$ (Abramowitz & Stegun 7.3.11, 7.3.13); beyond, the relation to the error function $C + jS = \frac{1+j}{2} \operatorname{erf}(z)$, $z = \frac{\sqrt{\pi}}{2}(1-j)x$ (A&S 7.3.22), with $\operatorname{erfc}(z) = \frac{e^{-z^{2}}}{\sqrt{\pi}} \cfrac{1}{z + \cfrac{1/2}{z + \cfrac{1}{z + \cfrac{3/2}{z + \dotsb}}}}$ (A&S 7.1.14, valid for $\operatorname{Re} z > 0$), evaluated by the modified Lentz method. $C$ and $S$ are odd.