jax.scipy.special.fresnel#
- jax.scipy.special.fresnel = <jax._src.custom_derivatives.custom_jvp object>[source]#
The Fresnel integrals
JAX implementation of
scipy.special.fresnel
.- The Fresnel integrals are defined as
- \[\begin{split}S(x) &= \int_0^x \sin(\pi t^2 /2) dt \\ C(x) &= \int_0^x \cos(\pi t^2 /2) dt.\end{split}\]
- Parameters:
x (ArrayLike) – arraylike, real-valued.
- Returns:
Arrays containing the values of the Fresnel integrals.
- Return type:
Notes
The JAX version only supports real-valued inputs, and is based on the SciPy C++ implementation, see here. For
float32
dtypes, the implementation is directly based on the Cephes implementationfresnlf
.As for the original Cephes implementation, the accuracy is only guaranteed in the domain [-10, 10]. Outside of that domain, one could observe divergence between the theoretical derivatives and the custom JVP implementation, especially for large input values.
Finally, for half-precision data types,
float16
andbfloat16
, the array elements are upcasted tofloat32
as the Cephes coefficients used in series expansions would otherwise lead to poor results. Other data types, likefloat8
, are not supported.