You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Fresnel Integrals are two functions $$S(x)=\int_0^x \sin(t^2),dt$$
and $$C(x)=\int_0^x \cos(t^2),dt$$
which come up a lot in optics and stuff. It'd be nice if we could provide these functions to users, but there's no material on them in Numerical Recipes. I've experimented with a few different approximations, but I think the nicest is probably the one due to J. Boersma in this paper (doi↗).
The only trouble is, it uses $i$ in the calculations, so I would need to use the num_complex crate. I know this was discussed in #6 a few months ago. I'm happy to draft a PR if this sounds like a useful contribution...
The text was updated successfully, but these errors were encountered:
Never mind, Boersma's approximation is awful—it underflows like crazy. Julia's package for the Fresnel integrals simply uses the relation to the error function $\mathrm{erf}(z)$ instead of numerically estimating the Fresnel integral directly. I don't blame them—every algorithm I've found is either accurate to maybe three significant figures, or quite complicated and easy to get wrong.
To use the error function relation, I'd need a complex implementation of $\mathrm{erf}(z)$...
The Fresnel Integrals are two functions
$$S(x)=\int_0^x \sin(t^2),dt$$
$$C(x)=\int_0^x \cos(t^2),dt$$
and
which come up a lot in optics and stuff. It'd be nice if we could provide these functions to users, but there's no material on them in Numerical Recipes. I've experimented with a few different approximations, but I think the nicest is probably the one due to J. Boersma in this paper (doi↗).
The only trouble is, it uses$i$ in the calculations, so I would need to use the
num_complex
crate. I know this was discussed in #6 a few months ago. I'm happy to draft a PR if this sounds like a useful contribution...The text was updated successfully, but these errors were encountered: