Skip to main content

Module bessel

Module bessel 

Source
Expand description

Scalar reference for i0e, i1e and xlogy, and the coefficient tables the vector kernels in crate::f64x::special share with it.

§Provenance

Ported from SciPy’s xsf (BSD-3-Clause), commit 39019a470a208221d55a587f0baa329c3d1054c5:

  • include/xsf/cephes/i0.h — i0e (Cephes, Copyright 1984, 1987, 2000 Stephen L. Moshier),
  • include/xsf/cephes/i1.h — i1e (Cephes, Copyright 1985, 1987, 2000 Stephen L. Moshier),
  • include/xsf/cephes/chbevl.h — the Clenshaw recurrence,
  • include/xsf/log.h — xlogy.

The coefficient tables below were extracted mechanically from those headers, not retyped. The BSD-3-Clause text is in THIRD-PARTY-LICENSES.

§Why this module exists

It is the scalar half of the “scalar reference / SIMD path” pair. Every fused operation uses f64::mul_add (one rounding) in the same order as the vector kernels use mul_add_precise, and sqrt and / are correctly rounded on both sides, so i0e and i1e here are bit-identical to the vector kernels on every SIMD level. xlogy is not: it calls the platform’s ln, the kernel calls the 1.0 ULP SLEEF log. Without the simd feature these functions are the slice entry points’ implementation.

Traits§

XlogyScalar
Floating-point types xlogy is defined for.

Functions§

i0e
exp(-|x|) I0(x), the exponentially scaled modified Bessel function of order zero.
i1e
exp(-|x|) I1(x), the exponentially scaled modified Bessel function of order one.
xlogy
x * ln(y) with the convention xlogy(0, y) = 0 for every y that is not NaN.