res = TAYLOR_SLOW (x, 0, cor);
if (res == res + 1.0007 * cor)
return res;
- else
- {
- __dubsin (fabs (x), 0, w);
- if (w[0] == w[0] + 1.000000001 * w[1])
- return (x > 0) ? w[0] : -w[0];
- else
- return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
- }
+
+ __dubsin (fabs (x), 0, w);
+ if (w[0] == w[0] + 1.000000001 * w[1])
+ return (x > 0) ? w[0] : -w[0];
+
+ return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
}
/*******************************************************************************/
res = do_sin_slow (u, y, 0, 0, &cor);
if (res == res + cor)
return (x > 0) ? res : -res;
- else
- {
- __dubsin (fabs (x), 0, w);
- if (w[0] == w[0] + 1.000000005 * w[1])
- return (x > 0) ? w[0] : -w[0];
- else
- return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
- }
+
+ __dubsin (fabs (x), 0, w);
+ if (w[0] == w[0] + 1.000000005 * w[1])
+ return (x > 0) ? w[0] : -w[0];
+
+ return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
}
/**************************************************************************/
res = do_cos_slow (u, y, del, 0, &cor);
if (res == res + cor)
return (x > 0) ? res : -res;
- else
- {
- y = fabs (x) - hp0;
- y1 = y - hp1;
- y2 = (y - y1) - hp1;
- __docos (y1, y2, w);
- if (w[0] == w[0] + 1.000000005 * w[1])
- return (x > 0) ? w[0] : -w[0];
- else
- return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
- }
+
+ y = fabs (x) - hp0;
+ y1 = y - hp1;
+ y2 = (y - y1) - hp1;
+ __docos (y1, y2, w);
+ if (w[0] == w[0] + 1.000000005 * w[1])
+ return (x > 0) ? w[0] : -w[0];
+
+ return (x > 0) ? __mpsin (x, 0, false) : -__mpsin (-x, 0, false);
}
/***************************************************************************/
if (res == res + cor)
return res;
+
+ (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
+ if (w[1] > 0)
+ cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-30;
else
+ cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-30;
+
+ if (w[0] == w[0] + cor)
+ return (x > 0) ? w[0] : -w[0];
+
+ t = (orig * hpinv + toint);
+ xn = t - toint;
+ v.x = t;
+ y = (orig - xn * mp1) - xn * mp2;
+ n = v.i[LOW_HALF] & 3;
+ da = xn * pp3;
+ t = y - da;
+ da = (y - t) - da;
+ y = xn * pp4;
+ a = t - y;
+ da = ((t - a) - y) + da;
+ if (n & 2)
{
- (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
- if (w[1] > 0)
- cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-30;
- else
- cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-30;
+ a = -a;
+ da = -da;
+ }
+ (a > 0) ? __dubsin (a, da, w) : __dubsin (-a, -da, w);
+ if (w[1] > 0)
+ cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-40;
+ else
+ cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-40;
- if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
- else
- {
- t = (orig * hpinv + toint);
- xn = t - toint;
- v.x = t;
- y = (orig - xn * mp1) - xn * mp2;
- n = v.i[LOW_HALF] & 3;
- da = xn * pp3;
- t = y - da;
- da = (y - t) - da;
- y = xn * pp4;
- a = t - y;
- da = ((t - a) - y) + da;
- if (n & 2)
- {
- a = -a;
- da = -da;
- }
- (a > 0) ? __dubsin (a, da, w) : __dubsin (-a, -da, w);
- if (w[1] > 0)
- cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-40;
- else
- cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-40;
+ if (w[0] == w[0] + cor)
+ return (a > 0) ? w[0] : -w[0];
- if (w[0] == w[0] + cor)
- return (a > 0) ? w[0] : -w[0];
- else
- return __mpsin (orig, 0, true);
- }
- }
+ return __mpsin (orig, 0, true);
}
/***************************************************************************/
if (res == res + cor)
return (m > 0) ? res : -res;
+
+ __dubsin (x, dx, w);
+
+ if (w[1] > 0)
+ cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
else
- {
- __dubsin (x, dx, w);
+ cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
- if (w[1] > 0)
- cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
- else
- cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
+ if (w[0] == w[0] + cor)
+ return (m > 0) ? w[0] : -w[0];
- if (w[0] == w[0] + cor)
- return (m > 0) ? w[0] : -w[0];
- else
- return __mpsin (orig, 0, true);
- }
+ return __mpsin (orig, 0, true);
}
/***************************************************************************/
if (res == res + cor)
return (n & 2) ? -res : res;
+
+ __docos (x, dx, w);
+
+ if (w[1] > 0)
+ cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
else
- {
- __docos (x, dx, w);
+ cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
- if (w[1] > 0)
- cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
- else
- cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
+ if (w[0] == w[0] + cor)
+ return (n & 2) ? -w[0] : w[0];
- if (w[0] == w[0] + cor)
- return (n & 2) ? -w[0] : w[0];
- else
- return __mpsin (orig, 0, true);
- }
+ return __mpsin (orig, 0, true);
}
/***************************************************************************/
cor = (cor > 0) ? 1.0005 * cor + 1.1e-24 : 1.0005 * cor - 1.1e-24;
if (res == res + cor)
return res;
+
+ (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
+ if (w[1] > 0)
+ cor = 1.000000001 * w[1] + 1.1e-24;
else
- {
- (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
- if (w[1] > 0)
- cor = 1.000000001 * w[1] + 1.1e-24;
- else
- cor = 1.000000001 * w[1] - 1.1e-24;
- if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
- else
- return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
- }
+ cor = 1.000000001 * w[1] - 1.1e-24;
+
+ if (w[0] == w[0] + cor)
+ return (x > 0) ? w[0] : -w[0];
+
+ return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
}
/***************************************************************************/
res = do_sin_slow (u, y, dx, 1.1e-24, &cor);
if (res == res + cor)
return (x > 0) ? res : -res;
+
+ __dubsin (fabs (x), dx, w);
+
+ if (w[1] > 0)
+ cor = 1.000000005 * w[1] + 1.1e-24;
else
- {
- __dubsin (fabs (x), dx, w);
+ cor = 1.000000005 * w[1] - 1.1e-24;
- if (w[1] > 0)
- cor = 1.000000005 * w[1] + 1.1e-24;
- else
- cor = 1.000000005 * w[1] - 1.1e-24;
+ if (w[0] == w[0] + cor)
+ return (x > 0) ? w[0] : -w[0];
- if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
- else
- return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
- }
+ return (n & 1) ? __mpcos (orig, 0, true) : __mpsin (orig, 0, true);
}
/***************************************************************************/
res = do_cos_slow (u, y, dx, 1.1e-24, &cor);
if (res == res + cor)
return (n & 2) ? -res : res;
+
+ __docos (fabs (x), dx, w);
+
+ if (w[1] > 0)
+ cor = 1.000000005 * w[1] + 1.1e-24;
else
- {
- __docos (fabs (x), dx, w);
+ cor = 1.000000005 * w[1] - 1.1e-24;
- if (w[1] > 0)
- cor = 1.000000005 * w[1] + 1.1e-24;
- else
- cor = 1.000000005 * w[1] - 1.1e-24;
+ if (w[0] == w[0] + cor)
+ return (n & 2) ? -w[0] : w[0];
- if (w[0] == w[0] + cor)
- return (n & 2) ? -w[0] : w[0];
- else
- return (n & 1) ? __mpsin (orig, 0, true) : __mpcos (orig, 0, true);
- }
+ return (n & 1) ? __mpsin (orig, 0, true) : __mpcos (orig, 0, true);
}
/************************************************************************/
res = do_cos_slow (u, y, 0, 0, &cor);
if (res == res + cor)
return res;
- else
- {
- y = fabs (x);
- __docos (y, 0, w);
- if (w[0] == w[0] + 1.000000005 * w[1])
- return w[0];
- else
- return __mpcos (x, 0, false);
- }
+
+ y = fabs (x);
+ __docos (y, 0, w);
+ if (w[0] == w[0] + 1.000000005 * w[1])
+ return w[0];
+
+ return __mpcos (x, 0, false);
}
/***************************************************************************/
if (res == res + cor)
return res;
+
+ (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
+
+ if (w[1] > 0)
+ cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-30;
else
+ cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-30;
+
+ if (w[0] == w[0] + cor)
+ return (x > 0) ? w[0] : -w[0];
+
+ t = (orig * hpinv + toint);
+ xn = t - toint;
+ v.x = t;
+ y = (orig - xn * mp1) - xn * mp2;
+ n = v.i[LOW_HALF] & 3;
+ da = xn * pp3;
+ t = y - da;
+ da = (y - t) - da;
+ y = xn * pp4;
+ a = t - y;
+ da = ((t - a) - y) + da;
+ if (n == 1)
{
- (x > 0) ? __dubsin (x, dx, w) : __dubsin (-x, -dx, w);
-
- if (w[1] > 0)
- cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-30;
- else
- cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-30;
+ a = -a;
+ da = -da;
+ }
+ (a > 0) ? __dubsin (a, da, w) : __dubsin (-a, -da, w);
- if (w[0] == w[0] + cor)
- return (x > 0) ? w[0] : -w[0];
- else
- {
- t = (orig * hpinv + toint);
- xn = t - toint;
- v.x = t;
- y = (orig - xn * mp1) - xn * mp2;
- n = v.i[LOW_HALF] & 3;
- da = xn * pp3;
- t = y - da;
- da = (y - t) - da;
- y = xn * pp4;
- a = t - y;
- da = ((t - a) - y) + da;
- if (n == 1)
- {
- a = -a;
- da = -da;
- }
- (a > 0) ? __dubsin (a, da, w) : __dubsin (-a, -da, w);
+ if (w[1] > 0)
+ cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-40;
+ else
+ cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-40;
- if (w[1] > 0)
- cor = 1.000000001 * w[1] + fabs (orig) * 1.1e-40;
- else
- cor = 1.000000001 * w[1] - fabs (orig) * 1.1e-40;
+ if (w[0] == w[0] + cor)
+ return (a > 0) ? w[0] : -w[0];
- if (w[0] == w[0] + cor)
- return (a > 0) ? w[0] : -w[0];
- else
- return __mpcos (orig, 0, true);
- }
- }
+ return __mpcos (orig, 0, true);
}
/***************************************************************************/
if (res == res + cor)
return (m > 0) ? res : -res;
+
+ __dubsin (x, dx, w);
+ if (w[1] > 0)
+ cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
else
- {
- __dubsin (x, dx, w);
- if (w[1] > 0)
- cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
- else
- cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
- if (w[0] == w[0] + cor)
- return (m > 0) ? w[0] : -w[0];
- else
- return __mpcos (orig, 0, true);
- }
+ cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
+
+ if (w[0] == w[0] + cor)
+ return (m > 0) ? w[0] : -w[0];
+
+ return __mpcos (orig, 0, true);
}
if (res == res + cor)
return (n) ? -res : res;
+
+ __docos (x, dx, w);
+ if (w[1] > 0)
+ cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
else
- {
- __docos (x, dx, w);
- if (w[1] > 0)
- cor = 1.000000005 * w[1] + 1.1e-30 * fabs (orig);
- else
- cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
- if (w[0] == w[0] + cor)
- return (n) ? -w[0] : w[0];
- else
- return __mpcos (orig, 0, true);
- }
+ cor = 1.000000005 * w[1] - 1.1e-30 * fabs (orig);
+ if (w[0] == w[0] + cor)
+ return (n) ? -w[0] : w[0];
+
+ return __mpcos (orig, 0, true);
}
#ifndef __cos