fast image operations
1
2
3
4
5
6
7
8
9
10
//! utility math
/// Calculates `a * b + c`, with hardware support if possible.
#[allow(clippy::suboptimal_flops)]
pub fn madd(a: f32, b: f32, c: f32) -> f32 {
    if cfg!(target_feature = "fma") {
        a.mul_add(b, c)
    } else {
        a * b + c
    }
}