Trait vrl::SIMDFusedCalc
source · pub trait SIMDFusedCalc {
// Required methods
fn mul_add(self, b: Self, c: Self) -> Self;
fn mul_sub(self, b: Self, c: Self) -> Self;
fn nmul_add(self, b: Self, c: Self) -> Self;
fn nmul_sub(self, b: Self, c: Self) -> Self;
}
Required Methods§
sourcefn mul_add(self, b: Self, c: Self) -> Self
fn mul_add(self, b: Self, c: Self) -> Self
Multiplies vector by b
and adds c
to the product.
§Exmaples
let a = Vec4f::new(1.0, 2.0, 0.5, 2.0);
let b = Vec4f::new(1.0, 0.5, 2.0, 3.0);
let c = Vec4f::new(4.0, 2.0, 3.0, 1.0);
assert_eq!(a.mul_add(b, c), a * b + c);
sourcefn mul_sub(self, b: Self, c: Self) -> Self
fn mul_sub(self, b: Self, c: Self) -> Self
Multiplies vector by b
ans substracts c
from the procuct.
§Exmaples
let a = Vec4f::new(1.0, 2.0, 0.5, 2.0);
let b = Vec4f::new(1.0, 0.5, 2.0, 3.0);
let c = Vec4f::new(4.0, 2.0, 3.0, 1.0);
assert_eq!(a.mul_sub(b, c), a * b - c);
Object Safety§
This trait is not object safe.