{
res = do_sin (a, da, &cor);
cor = 1.035 * cor + __copysign (eps, cor);
- retval = ((res == res + cor) ? ((a > 0) ? res : -res)
+ retval = ((res == res + cor) ? __copysign (res, a)
: sloww1 (a, da, x, k));
}
break;
{
res = do_sin (a, da, &cor);
cor = 1.035 * cor + __copysign (eps, cor);
- retval = ((res == res + cor) ? ((a > 0) ? res : -res)
+ retval = ((res == res + cor) ? __copysign (res, a)
: bsloww1 (a, da, x, n));
}
break;
{
res = do_sin (x, 0, &cor);
retval = (res == res + 1.096 * cor) ? res : slow1 (x);
- retval = m > 0 ? retval : -retval;
+ retval = __copysign (retval, x);
} /* else if (k < 0x3feb6000) */
/*----------------------- 0.855469 <|x|<2.426265 ----------------------*/
t = hp0 - fabs (x);
res = do_cos (t, hp1, &cor);
retval = (res == res + 1.020 * cor) ? res : slow2 (x);
- retval = m > 0 ? retval : -retval;
+ retval = __copysign (retval, x);
} /* else if (k < 0x400368fd) */
#ifndef IN_SINCOS
{
res = do_sin (a, da, &cor);
cor = 1.035 * cor + __copysign (1.0e-31, cor);
- retval = ((res == res + cor) ? ((a > 0) ? res : -res)
+ retval = ((res == res + cor) ? __copysign (res, a)
: sloww1 (a, da, x, 1));
}
__dubsin (fabs (x), 0, w);
if (w[0] == w[0] + 1.000000001 * w[1])
- return (x > 0) ? w[0] : -w[0];
+ return __copysign (w[0], x);
- return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
+ return __copysign (__mpsin (fabs (x), 0, false), x);
}
/*******************************************************************************/
cor = 1.000000001 * w[1] + __copysign (eps, w[1]);
if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
+ return __copysign (w[0], x);
t = (orig * hpinv + toint);
xn = t - toint;
cor = 1.000000001 * w[1] + __copysign (eps, w[1]);
if (w[0] == w[0] + cor)
- return (a > 0) ? w[0] : -w[0];
+ return __copysign (w[0], a);
return k ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
}
res = do_sin_slow (x, dx, 3.1e-30 * fabs (orig), &cor);
if (res == res + cor)
- return (x > 0) ? res : -res;
+ return __copysign (res, x);
dx = (x > 0 ? dx : -dx);
__dubsin (fabs (x), dx, w);
cor = 1.000000005 * w[1] + __copysign (eps, w[1]);
if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
+ return __copysign (w[0], x);
return (k == 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
}
cor = 1.000000001 * w[1] + __copysign (1.1e-24, w[1]);
if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
+ return __copysign (w[0], x);
return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
}
cor = 1.000000005 * w[1] + __copysign (1.1e-24, w[1]);
if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
+ return __copysign (w[0], x);
return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
}