Skip to main content

ExpIntDetails

Trait ExpIntDetails 

Source
pub trait ExpIntDetails<E, V: FloatVector<Element = E>> {
    // Provided methods
    fn use_series(z: V) -> V::Mask { ... }
    fn invalid(z: V) -> V::Mask { ... }
    fn cf_tiny() -> V { ... }
}
Expand description

The decisions the expint kernel has to make differently depending on the arithmetic it is running in.

These are choices inside one algorithm, not part of the math surface, so they live here rather than on SpecializedSpecialMath itself. They exist because a single series/continued-fraction body serves both the real line and the complex cut plane, and “the unit disc”, “out of domain” and “negligible but nonzero” are three different comparisons in those two worlds.

Every method defaults to the real-line answer, so a real vector’s implementation is empty and its ExpIntDetails is Self.

Provided Methods§

Source

fn use_series(z: V) -> V::Mask

Lanes that should take the power series rather than the continued fraction.

On the real line this is x < 1. Over C it is |z| < 1, which is not what a complex cmp_lt means. That is a lexicographic sort order, and reading it as a magnitude silently routes far-off-axis points into the wrong regime.

Source

fn invalid(z: V) -> V::Mask

Lanes outside the domain, forced to NaN when the policy checks overflow.

Real E_N is defined for x >= 0 only. The complex principal branch covers the whole cut plane |Arg z| < pi, so there the negative reals are in-domain and the cut is carried entirely by the principal ln inside the series.

Source

fn cf_tiny() -> V

Lentz sentinel: the stand-in for a denominator that came out exactly zero, small enough to be negligible against any real term.

The safe magnitude depends on the arithmetic, not just the format. Real division only needs this to be tiny and nonzero, so MIN_POSITIVE is ideal. A complex reciprocal divides by |z|^2, so both the sentinel and its reciprocal have to survive being squared - MIN_POSITIVE underflows to zero there, which takes the whole fraction to NaN.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<V: FloatVectorWithBits<Element = f32>> ExpIntDetails<f32, V> for V

Every default applies: expint on the real line is what they were written for.

Source§

impl<V: FloatVectorWithBits<Element = f64>> ExpIntDetails<f64, V> for V

Every default applies: expint on the real line is what they were written for.

Last built: 2026-09-08 21:35:55 UTC