Skip to main content

fmuladd

Function fmuladd 

Source
pub const fn fmuladd<T: FloatPrimitive>(a: T, b: T, c: T) -> T
🔬This is a nightly-only experimental API. (core_intrinsics)
Expand description

Returns a * b + c, non-deterministically executing either a fused multiply-add or two operations with rounding of the intermediate result.

The operation is fused if the code generator determines that target instruction set has support for a fused operation, and that the fused operation is more efficient than the equivalent, separate pair of mul and add instructions. It is unspecified whether or not a fused operation is selected, and that may depend on optimization level and context, for example.

The stabilized versions of this intrinsic are available on the float primitives via the mul_add_relaxed method. For example, f32::mul_add_relaxed.