if(ix>=0x7ff00000) return one/x;
y = fabs(x);
if(ix >= 0x40000000) { /* |x| >= 2.0 */
- s = __sin(y);
- c = __cos(y);
+ __sincos (y, &s, &c);
ss = -s-c;
cc = s-c;
if(ix<0x7fe00000) { /* make sure y+y not overflow */
if((ix|lx)==0) return -one/zero;
if(hx<0) return zero/zero;
if(ix >= 0x40000000) { /* |x| >= 2.0 */
- s = __sin(x);
- c = __cos(x);
+ __sincos (x, &s, &c);
ss = -s-c;
cc = s-c;
if(ix<0x7fe00000) { /* make sure x+x not overflow */
* 2 -s+c -c-s
* 3 s+c c-s
*/
+ double s;
+ double c;
+ __sincos (x, &s, &c);
switch(n&3) {
- case 0: temp = __cos(x)+__sin(x); break;
- case 1: temp = -__cos(x)+__sin(x); break;
- case 2: temp = -__cos(x)-__sin(x); break;
- case 3: temp = __cos(x)-__sin(x); break;
+ case 0: temp = c + s; break;
+ case 1: temp = -c + s; break;
+ case 2: temp = -c - s; break;
+ case 3: temp = c - s; break;
}
b = invsqrtpi*temp/__ieee754_sqrt(x);
} else {
* 2 -s+c -c-s
* 3 s+c c-s
*/
+ double c;
+ double s;
+ __sincos (x, &s, &c);
switch(n&3) {
- case 0: temp = __sin(x)-__cos(x); break;
- case 1: temp = -__sin(x)-__cos(x); break;
- case 2: temp = -__sin(x)+__cos(x); break;
- case 3: temp = __sin(x)+__cos(x); break;
+ case 0: temp = s - c; break;
+ case 1: temp = -s - c; break;
+ case 2: temp = -s + c; break;
+ case 3: temp = s + c; break;
}
b = invsqrtpi*temp/__ieee754_sqrt(x);
} else {
if(ix>=0x7f800000) return one/x;
y = fabsf(x);
if(ix >= 0x40000000) { /* |x| >= 2.0 */
- s = __sinf(y);
- c = __cosf(y);
+ __sincosf (y, &s, &c);
ss = -s-c;
cc = s-c;
if(ix<0x7f000000) { /* make sure y+y not overflow */
if(ix==0) return -one/zero;
if(hx<0) return zero/zero;
if(ix >= 0x40000000) { /* |x| >= 2.0 */
- s = __sinf(x);
- c = __cosf(x);
+ __sincosf (x, &s, &c);
ss = -s-c;
cc = s-c;
if(ix<0x7f000000) { /* make sure x+x not overflow */