1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! `i0e`, `i1e` and `xlogy` over native-width `f32` vectors.
//!
//! Provenance as for [`crate::f64x::special`]: SciPy's [xsf] (BSD-3-Clause) commit
//! `39019a470a208221d55a587f0baa329c3d1054c5`. xsf has no single-precision series for these
//! functions (SciPy evaluates its `float32` loops in `double`), so neither does this module:
//!
//! * [`i0e`] and [`i1e`] widen each lane to `f64`, run the `f64` kernel on both halves, and
//! narrow. The `f64` result is within about `6e-16` relative of the true value, so the rounded
//! `f32` is correctly rounded except for the rare input whose true value lies within that
//! distance of a rounding boundary: the bound is `0.5001 ULP`. No second coefficient set is
//! needed.
//! * [`xlogy`] stays in `f32` on [`u10::log`] (1.0 ULP) plus one multiplication: `1.5 ULP`.
//!
//! [xsf]: https://github.com/scipy/xsf
//!
//! Bit-identity: all three are bit-identical on every SIMD level. [`i0e`] and [`i1e`] are
//! bit-identical to the scalar reference `crate::bessel::i0e(x as f64) as f32`; [`xlogy`] is not
//! (the scalar reference uses the platform `ln`).
use *;
/// `exp(-|x|) I0(x)` for `f32`; `0.5001 ULP`, finite for every input (`i0e(+-inf) = 0`).
/// `exp(-|x|) I1(x)` for `f32`; `0.5001 ULP`, odd in `x`, `i1e(+-inf) = +-0`.
/// `x * ln(y)` for `f32`, defined as `0` when `x == 0` and `y` is not NaN; `1.5 ULP`.
///
/// Special cases are those of [`crate::f64x::special::xlogy`].