Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libm / common / sf_fma.c
blobce7f13bb27ff30a73a691cc0310a516ae9a913b9
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.
5 */
7 #include "fdlibm.h"
9 #if !HAVE_FAST_FMAF
11 #ifdef __STDC__
12 float fmaf(float x, float y, float z)
13 #else
14 float fmaf(x,y,z)
15 float x;
16 float y;
17 float z;
18 #endif
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);
30 #endif
32 #ifdef _DOUBLE_IS_32BITS
34 #ifdef __STDC__
35 double fma(double x, double y, double z)
36 #else
37 double fma(x,y,z)
38 double x;
39 double y;
40 double z;
41 #endif
43 return (double) fmaf((float) x, (float) y, (float) z);
46 #endif /* defined(_DOUBLE_IS_32BITS) */