pub trait EdgeSimd: Sized + Copy {
// Required methods
fn dot_simd(a: &[Self], b: &[Self]) -> Self;
fn exp_in_place_simd(x: &mut [Self]);
}Expand description
SIMD-accelerated primitives over slices of a float type.
Implemented once per concrete float type; algorithm code never dispatches on the type itself.
Required Methods§
Sourcefn exp_in_place_simd(x: &mut [Self])
fn exp_in_place_simd(x: &mut [Self])
Exponentiates a slice in place.
This is the mu = exp(eta) step of every GLM fit in the crate, so it
sits on the hottest path there is.
§Params
x- Values to exponentiate, modified in place
Note that each tier vectorises what it can and hands the remainder down,
and the last tier calls libm. wide’s polynomial and libm disagree in
the last ulp, so the same input value can come back with two different
bit patterns depending on where in the slice it sits, on the slice
length, and on which tier the machine dispatched to: vec![0.37; n]
gives two distinct patterns for every odd n. This is elementwise rather
than a reassociation, so it is a stronger caveat than the one on
EdgeSimd::dot_simd, but the magnitude is still one ulp and nothing in
the crate depends on it. The vector lanes also flush a deep underflow to
zero where libm returns a subnormal: exp(-745.0) is exactly 0 in a
lane, 5e-324 in the tail.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".