diff options
| author | David Schultz <das@FreeBSD.org> | 2011-10-21 06:30:43 +0000 |
|---|---|---|
| committer | David Schultz <das@FreeBSD.org> | 2011-10-21 06:30:43 +0000 |
| commit | 0c7e4d5fc1fc5b7ecbe565d6324cb6253bec5ebe (patch) | |
| tree | 61f25cba269fd9ea7a9e512007292525d6413b6d /lib/msun | |
| parent | bc23acdc32e97d4324fcfb21aa92e4f95e3b230e (diff) | |
Notes
Diffstat (limited to 'lib/msun')
| -rw-r--r-- | lib/msun/src/s_fma.c | 6 | ||||
| -rw-r--r-- | lib/msun/src/s_fmal.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/msun/src/s_fma.c b/lib/msun/src/s_fma.c index 9cb0ddc8ac53e..dfbd13c468153 100644 --- a/lib/msun/src/s_fma.c +++ b/lib/msun/src/s_fma.c @@ -250,6 +250,8 @@ fma(double x, double y, double z) xy = dd_mul(xs, ys); r = dd_add(xy.hi, zs); + spread = ex + ey; + if (r.hi == 0.0) { /* * When the addends cancel to 0, ensure that the result has @@ -257,11 +259,9 @@ fma(double x, double y, double z) */ fesetround(oround); volatile double vzs = zs; /* XXX gcc CSE bug workaround */ - return (xy.hi + vzs); + return (xy.hi + vzs + ldexp(xy.lo, spread)); } - spread = ex + ey; - if (oround != FE_TONEAREST) { /* * There is no need to worry about double rounding in directed diff --git a/lib/msun/src/s_fmal.c b/lib/msun/src/s_fmal.c index 59fa6cd4ffefd..c2a6913509998 100644 --- a/lib/msun/src/s_fmal.c +++ b/lib/msun/src/s_fmal.c @@ -238,6 +238,8 @@ fmal(long double x, long double y, long double z) xy = dd_mul(xs, ys); r = dd_add(xy.hi, zs); + spread = ex + ey; + if (r.hi == 0.0) { /* * When the addends cancel to 0, ensure that the result has @@ -245,11 +247,9 @@ fmal(long double x, long double y, long double z) */ fesetround(oround); volatile long double vzs = zs; /* XXX gcc CSE bug workaround */ - return (xy.hi + vzs); + return (xy.hi + vzs + ldexpl(xy.lo, spread)); } - spread = ex + ey; - if (oround != FE_TONEAREST) { /* * There is no need to worry about double rounding in directed |
