jax.scipy.special.fresnel

目录

jax.scipy.special.fresnel#

jax.scipy.special.fresnel = <jax._src.custom_derivatives.custom_jvp object>[源代码][源代码]#

菲涅尔积分

JAX implementation of scipy.special.fresnel.

菲涅尔积分定义为
\[\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}\]
参数:

x (ArrayLike) – 类数组,实值。

返回:

包含菲涅尔积分值的数组。

返回类型:

tuple[Array, Array]

备注

JAX 版本仅支持实值输入,并且基于 SciPy 的 C++ 实现,参见 这里。对于 float32 数据类型,实现直接基于 Cephes 实现的 fresnlf

至于原始的 Cephes 实现,精度仅在域 [-10, 10] 内得到保证。在该域之外,特别是在输入值较大的情况下,可能会观察到理论导数与自定义 JVP 实现之间的偏差。

最后,对于半精度数据类型,float16bfloat16,数组元素会被提升为 float32,因为在级数展开中使用的 Cephes 系数如果不这样做会导致结果不佳。其他数据类型,如 float8,则不受支持。