|
constexprnoexcept |
Generic implementation of fused multiple-add (FMA).
T | A type that provides for multiplication and addition using the respective C++ operators * and + . If T is a standard floating-point type, i.e. float , double or long double, the operation is performed as if the rounding occurred only once after multiplication and addition with infinite precision are both complete. Otherwise, ordinary multiplication followed by addition are performed upon the operands. The chsvlib library calls this function using ADL, so other, i. e. for types other than generic T , implementations of fmadd can be used provided they are accessible via ADL. |
multiplicand1 | The first (left) multiplicand. |
multiplicand2 | The second (right) multiplicand. |
addend | The addend. |
The generic template function evaluates the result of
Specializations for standard floating-point types exist and delegate the call to the standard fmaf,
fma and
fmal functions in order to perform correct rounding of the result.
The functions should be accessed using ADL and are accessed this way from within chsvlib
so that custom implementations of FMA can be employed if necessary.