diff options
Diffstat (limited to 'sysdeps/libm-ieee754/s_remquo.c')
-rw-r--r-- | sysdeps/libm-ieee754/s_remquo.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/sysdeps/libm-ieee754/s_remquo.c b/sysdeps/libm-ieee754/s_remquo.c index 5a96f75f3b..53f26c6d89 100644 --- a/sysdeps/libm-ieee754/s_remquo.c +++ b/sysdeps/libm-ieee754/s_remquo.c @@ -29,71 +29,71 @@ static const double zero = 0.0; double __remquo (double x, double y, int *quo) { - int32_t hx,hp; - u_int32_t sx,lx,lp; - int cquo; + int32_t hx,hy; + u_int32_t sx,lx,ly; + int cquo, qs; EXTRACT_WORDS (hx, lx, x); - EXTRACT_WORDS (hp, lp, p); + EXTRACT_WORDS (hy, ly, y); sx = hx & 0x80000000; - qs = (sx ^ (hp & 0x80000000)) >> 31; - hp &= 0x7fffffff; + qs = sx ^ (hy & 0x80000000); + hy &= 0x7fffffff; hx &= 0x7fffffff; /* Purge off exception values. */ - if ((hp | lp) == 0) - return (x * p) / (x * p); /* p = 0 */ + if ((hy | ly) == 0) + return (x * y) / (x * y); /* y = 0 */ if ((hx >= 0x7ff00000) /* x not finite */ - || ((hp >= 0x7ff00000) /* p is NaN */ - && (((hp - 0x7ff00000) | lp) != 0))) - return (x * p) / (x * p); + || ((hy >= 0x7ff00000) /* p is NaN */ + && (((hy - 0x7ff00000) | ly) != 0))) + return (x * y) / (x * y); - if (hp <= 0x7fbfffff) + if (hy <= 0x7fbfffff) { - x = __ieee754_fmod (x, 8 * p); /* now x < 8p */ + x = __ieee754_fmod (x, 8 * y); /* now x < 8y */ - if (fabs (x) >= 4 * fabs (p)) + if (fabs (x) >= 4 * fabs (y)) cquo += 4; } - if (((hx - hp) | (lx - lp)) == 0) + if (((hx - hy) | (lx - ly)) == 0) { *quo = qs ? -1 : 1; return zero * x; } x = fabs (x); - p = fabs (p); + y = fabs (y); cquo = 0; - if (x >= 2 * p) + if (x >= 2 * y) { - x -= 4 * p; + x -= 4 * y; cquo += 2; } - if (x >= p) + if (x >= y) { - x -= 2 * p; + x -= 2 * y; ++cquo; } - if (hp < 0x00200000) + if (hy < 0x00200000) { - if (x + x > p) + if (x + x > y) { - x -= p; - if (x + x >= p) - x -= p; + x -= y; + if (x + x >= y) + x -= y; } } else { - double p_half = 0.5 * p; - if(x > p_half) + double y_half = 0.5 * y; + if(x > y_half) { - x -= p; - if (x >= p_half) - x -= p; + x -= y; + if (x >= y_half) + x -= y; } } |