Skip to main content

Crate elem_simd_math

Crate elem_simd_math 

Source
Expand description

elem-simd-math — vectorized elementwise math for f64.

This crate is a port of SLEEF as expressed by the sleef-rs crate, rewritten against the stable-Rust SIMD abstraction of fearless_simd so that it builds on stable Rust with runtime CPU feature detection. See NOTICE and THIRD-PARTY-LICENSES for the provenance and licensing of the derived portions.

§Layers

  • f64x exposes the ported kernels as functions generic over a fearless_simd::Simd token, operating on native-width vectors. Use these when you already own the SIMD loop.
  • ElementwiseMath exposes slice entry points that pick the best available SIMD level at runtime, with a scalar fallback.

§Accuracy

Kernels come from SLEEF’s four accuracy tiers and each function documents its tier’s error bound (u05 = 0.5 ULP, u10 = 1.0 ULP, u15 = 1.5 ULP, u35 = 3.5 ULP). Those bounds are asserted by the ported upstream test suites against MPFR. They bound the vector body; the value produced for inputs outside a kernel’s tested domain is documented per function.

Modules§

bessel
Scalar reference for i0e, i1e and xlogy, and the coefficient tables the vector kernels in crate::f64x::special share with it.
common
Type aliases for the f64 kernel family, and the translation table they follow.
constants
Scalar constants shared by the ported kernels.
doubled
Double-double (“double-float”) arithmetic over SIMD vectors.
f32
The f32 slice entry points are also available as free functions here.
f64
The f64 slice entry points are also available as free functions here.
f32x
Vector helpers for the f32 kernels.
f64x
Vector helpers for the f64 kernels.

Structs§

LengthMismatch
The source and destination lengths differ.

Traits§

ElementwiseMath
Elementwise math over contiguous slices.