double fma (double x , double y , double z); float fmaf (float x , float y , float z);long double fmal (long double x, long double y, long double z);
double fma (double x , double y , double z); float fma (float x , float y , float z);long double fma (long double x, long double y, long double z); double fma (Type1 x , Type2 y , Type3 z); // additional overloads
x*y+z
(such as when a hardware multiply-add instruction is used):macro | description |
---|---|
FP_FAST_FMA | For arguments of type double , it generally executes about as fast as, or faster than, x*y+z . |
FP_FAST_FMAF | For arguments of type float , it generally executes about as fast as, or faster than, x*y+z . |
FP_FAST_FMAL | For arguments of type long double , it generally executes about as fast as, or faster than, x*y+z . |
<cmath>
) for other combinations of arithmetic types (Type1, Type2 and Type3): These overloads effectively cast its arguments to double
before calculations, except if at least one of the arguments is of type long double
(in which case all of them are casted to long double
instead).x*y+z
|
|
10.0 * 20.0 + 30.0 = 230.000000 |