|
constexprnoexcept |
Generic implementation of fused multiple-subtract.
T | A type that provides for multiplication and subtraction 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 subtraction 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 fmsub can be used provided they are accessible via ADL. |
multiplicand1 | The first (left) multiplicand. |
multiplicand2 | The second (right) multiplicand. |
subtrahend | The subtrahend. |
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.