Print this page
11210 libm should be cstyle(1ONBLD) clean
*** 16,28 ****
--- 16,30 ----
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
+
/*
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
*/
+
/*
* Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
*** 30,39 ****
--- 32,42 ----
#include "libm.h"
extern const int _TBL_ipio2_inf[];
extern int __rem_pio2m(double *, double *, int, int, int, const int *);
+
#if defined(__i386) && !defined(__amd64)
extern int __swapRP(int);
#endif
static const double C[] = {
*** 91,116 ****
#ifdef lint
i = i;
#endif
return (x);
}
return ((float)((y * T0) * (T1 + y * y)));
}
z = y * y;
! return ((float)(((P0 * y) * (P1 + z * (P2 + z)) *
! (P3 + z * (P4 + z))) *
! (P5 + z * (P6 + z * (P7 + z)))));
}
if (hx > 0)
y = (y - pio2_1) - pio2_t;
else
y = (y + pio2_1) + pio2_t;
hy = ((int *)&y)[HIWORD] & ~0x80000000;
if (hy < 0x3f800000) { /* |y| < 2**-7 */
z = (y * T0) * (T1 + y * y);
return ((float)(-one / z));
}
z = y * y;
w = ((P0 * y) * (P1 + z * (P2 + z)) * (P3 + z * (P4 + z))) *
(P5 + z * (P6 + z * (P7 + z)));
return ((float)(-one / w));
}
--- 94,125 ----
#ifdef lint
i = i;
#endif
return (x);
}
+
return ((float)((y * T0) * (T1 + y * y)));
}
+
z = y * y;
! return ((float)(((P0 * y) * (P1 + z * (P2 + z)) * (P3 +
! z * (P4 + z))) * (P5 + z * (P6 + z *
! (P7 + z)))));
}
+
if (hx > 0)
y = (y - pio2_1) - pio2_t;
else
y = (y + pio2_1) + pio2_t;
+
hy = ((int *)&y)[HIWORD] & ~0x80000000;
+
if (hy < 0x3f800000) { /* |y| < 2**-7 */
z = (y * T0) * (T1 + y * y);
return ((float)(-one / z));
}
+
z = y * y;
w = ((P0 * y) * (P1 + z * (P2 + z)) * (P3 + z * (P4 + z))) *
(P5 + z * (P6 + z * (P7 + z)));
return ((float)(-one / w));
}
*** 120,159 ****
int rp;
rp = __swapRP(fp_extended);
#endif
w = y * invpio2;
if (hx < 0)
n = (int)(w - half);
else
n = (int)(w + half);
y = (y - n * pio2_1) - n * pio2_t;
#if defined(__i386) && !defined(__amd64)
if (rp != fp_extended)
(void) __swapRP(rp);
#endif
} else {
if (ix >= 0x7f800000)
return (x / x); /* sin(Inf or NaN) is NaN */
hy = ((int *)&y)[HIWORD];
n = ((hy >> 20) & 0x7ff) - 1046;
((int *)&w)[HIWORD] = (hy & 0xfffff) | 0x41600000;
((int *)&w)[LOWORD] = ((int *)&y)[LOWORD];
n = __rem_pio2m(&w, &y, n, 1, 0, _TBL_ipio2_inf);
if (hy < 0) {
y = -y;
n = -n;
}
}
hy = ((int *)&y)[HIWORD] & ~0x80000000;
if (hy < 0x3f800000) { /* |y| < 2**-7 */
z = (y * T0) * (T1 + y * y);
! f = ((n & 1) == 0)? (float)z : (float)(-one / z);
return (f);
}
z = y * y;
! w = ((P0 * y) * (P1 + z * (P2 + z)) * (P3 + z * (P4 + z))) *
! (P5 + z * (P6 + z * (P7 + z)));
! f = ((n & 1) == 0)? (float)w : (float)(-one / w);
return (f);
}
--- 129,174 ----
int rp;
rp = __swapRP(fp_extended);
#endif
w = y * invpio2;
+
if (hx < 0)
n = (int)(w - half);
else
n = (int)(w + half);
+
y = (y - n * pio2_1) - n * pio2_t;
#if defined(__i386) && !defined(__amd64)
if (rp != fp_extended)
(void) __swapRP(rp);
#endif
} else {
if (ix >= 0x7f800000)
return (x / x); /* sin(Inf or NaN) is NaN */
+
hy = ((int *)&y)[HIWORD];
n = ((hy >> 20) & 0x7ff) - 1046;
((int *)&w)[HIWORD] = (hy & 0xfffff) | 0x41600000;
((int *)&w)[LOWORD] = ((int *)&y)[LOWORD];
n = __rem_pio2m(&w, &y, n, 1, 0, _TBL_ipio2_inf);
+
if (hy < 0) {
y = -y;
n = -n;
}
}
hy = ((int *)&y)[HIWORD] & ~0x80000000;
+
if (hy < 0x3f800000) { /* |y| < 2**-7 */
z = (y * T0) * (T1 + y * y);
! f = ((n & 1) == 0) ? (float)z : (float)(-one / z);
return (f);
}
+
z = y * y;
! w = ((P0 * y) * (P1 + z * (P2 + z)) * (P3 + z * (P4 + z))) * (P5 + z *
! (P6 + z * (P7 + z)));
! f = ((n & 1) == 0) ? (float)w : (float)(-one / w);
return (f);
}