jax.scipy.special.fresnel#
- jax.scipy.special.fresnel = <jax._src.custom_derivatives.custom_jvp object>[原始碼]#
菲涅耳積分
JAX 實作的
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}\]
筆記
JAX 版本僅支援實數值輸入,並且基於 SciPy C++ 實作,請參閱此處。對於
float32
dtype,實作直接基於 Cephes 實作fresnlf
。如同原始 Cephes 實作,精度僅在 [-10, 10] 範圍內得到保證。在該範圍之外,可能會觀察到理論導數與自訂 JVP 實作之間的分歧,尤其是對於較大的輸入值。
最後,對於半精度資料型別
float16
和bfloat16
,陣列元素會向上轉換為float32
,因為級數展開中使用的 Cephes 係數否則會導致不良結果。不支援其他資料型別,例如float8
。