29 #ifdef POK_NEEDS_LIBMATH
66 #include "math_private.h"
68 static const double xxx[] = {
69 3.33333333333334091986e-01,
70 1.33333333333201242699e-01,
71 5.39682539762260521377e-02,
72 2.18694882948595424599e-02,
73 8.86323982359930005737e-03,
74 3.59207910759131235356e-03,
75 1.45620945432529025516e-03,
76 5.88041240820264096874e-04,
77 2.46463134818469906812e-04,
78 7.81794442939557092300e-05,
79 7.14072491382608190305e-05,
80 -1.85586374855275456654e-05,
81 2.59073051863633712884e-05,
82 1.00000000000000000000e+00,
83 7.85398163397448278999e-01,
84 3.06161699786838301793e-17
88 #define pio4lo xxx[15]
92 __kernel_tan(
double x,
double y,
int iy)
99 if (ix < 0x3e300000) {
102 GET_LOW_WORD(low, x);
103 if(((ix | low) | (iy + 1)) == 0)
104 return one / fabs(x);
117 return t + a * (s + t * v);
122 if (ix >= 0x3FE59428) {
139 r = T[1] + w * (T[3] + w * (T[5] + w * (T[7] + w * (T[9] +
141 v = z * (T[2] + w * (T[4] + w * (T[6] + w * (T[8] + w * (T[10] +
144 r = y + z * (s * (r + v) + y);
147 if (ix >= 0x3FE59428) {
149 return (
double) (1 - ((hx >> 30) & 2)) *
150 (v - 2.0 * (x - (w * w / (w + v) - r)));
167 return t + a * (s + t * v);