1 /* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved.
3 * Permission to use, copy, modify, and distribute this software
4 * is freely granted, provided that this notice is preserved.
12 float fmaf(float x
, float y
, float z
)
20 /* NOTE: The floating-point exception behavior of this is not as
21 * required. But since the basic function is not really done properly,
22 * it is not worth bothering to get the exceptions right, either. */
23 /* Let the implementation handle this. */ /* <= NONSENSE! */
24 /* In floating-point implementations in which double is larger than float,
25 * computing as double should provide the desired function. Otherwise,
26 * the behavior will not be as specified in the standards. */
27 return (float) (((double) x
* (double) y
) + (double) z
);
32 #ifdef _DOUBLE_IS_32BITS
35 double fma(double x
, double y
, double z
)
43 return (double) fmaf((float) x
, (float) y
, (float) z
);
46 #endif /* defined(_DOUBLE_IS_32BITS) */