90 p6 = 1.605904383643244375050998243778534074273e-0010L, 91 p7 = -7.647162722800685516901456114270824622699e-0013L, 92 p8 = 2.810046428661902961725428841068844462603e-0015L, 93 /* 94 * 2 10 -123.84 95 * |cos(x) - (1+qq1*x +...+ qq5*x )| <= 2 for |x|<=1/128 96 */ 97 qq1 = -4.999999999999999999999999999999378373641e-0001L, 98 qq2 = 4.166666666666666666666665478399327703130e-0002L, 99 qq3 = -1.388888888888888888058211230618051613494e-0003L, 100 qq4 = 2.480158730156105377771585658905303111866e-0005L, 101 qq5 = -2.755728099762526325736488376695157008736e-0007L; 102 /* INDENT ON */ 103 long double 104 __k_sinl(long double x, long double y) { 105 long double a, t, z, w; 106 int *pt = (int *) &t, *px = (int *) &x; 107 int i, j, hx, ix; 108 109 t = 1.0L; 110 #if defined(_BIG_ENDIAN) 111 hx = px[0]; 112 #else 113 XTOI(px, hx); 114 #endif 115 ix = hx & 0x7fffffff; 116 if (ix < 0x3ffc9000) { 117 if (ix < 0x3fc60000) 118 if (((int) x) == 0) 119 return (x); /* generate inexact */ 120 z = x * x; 121 t = z * (p1 + z * (p2 + z * (p3 + z * (p4 + z * (p5 + z * 122 (p6 + z * (p7 + z * p8))))))); 123 t = y + x * t; 124 return (x + t); 125 } 126 j = (ix + 0x400) & 0x7ffff800; 127 i = (j - 0x3ffc4000) >> 11; 128 #if defined(_BIG_ENDIAN) 129 pt[0] = j; 130 #else 131 ITOX(j, pt); 132 #endif 133 if (hx > 0) 134 x = y - (t - x); 135 else 136 x = (-y) - (t + x); 137 a = _TBL_sinl_hi[i]; 138 z = x * x; 139 t = z * (qq1 + z * (qq2 + z * (qq3 + z * (qq4 + z * qq5)))); 140 w = x * (one + z * (pp1 + z * (pp2 + z * (pp3 + z * (pp4 + z * 141 pp5))))); 142 t = _TBL_cosl_hi[i] * w + a * t; 143 t += _TBL_sinl_lo[i]; 144 if (hx < 0) 145 return (-a - t); 146 else 147 return (a + t); 148 } | 90 p6 = 1.605904383643244375050998243778534074273e-0010L, 91 p7 = -7.647162722800685516901456114270824622699e-0013L, 92 p8 = 2.810046428661902961725428841068844462603e-0015L, 93 /* 94 * 2 10 -123.84 95 * |cos(x) - (1+qq1*x +...+ qq5*x )| <= 2 for |x|<=1/128 96 */ 97 qq1 = -4.999999999999999999999999999999378373641e-0001L, 98 qq2 = 4.166666666666666666666665478399327703130e-0002L, 99 qq3 = -1.388888888888888888058211230618051613494e-0003L, 100 qq4 = 2.480158730156105377771585658905303111866e-0005L, 101 qq5 = -2.755728099762526325736488376695157008736e-0007L; 102 /* INDENT ON */ 103 long double 104 __k_sinl(long double x, long double y) { 105 long double a, t, z, w; 106 int *pt = (int *) &t, *px = (int *) &x; 107 int i, j, hx, ix; 108 109 t = 1.0L; 110 #if defined(__i386) || defined(__amd64) 111 XTOI(px, hx); 112 #else 113 hx = px[0]; 114 #endif 115 ix = hx & 0x7fffffff; 116 if (ix < 0x3ffc9000) { 117 if (ix < 0x3fc60000) 118 if (((int) x) == 0) 119 return (x); /* generate inexact */ 120 z = x * x; 121 t = z * (p1 + z * (p2 + z * (p3 + z * (p4 + z * (p5 + z * 122 (p6 + z * (p7 + z * p8))))))); 123 t = y + x * t; 124 return (x + t); 125 } 126 j = (ix + 0x400) & 0x7ffff800; 127 i = (j - 0x3ffc4000) >> 11; 128 #if defined(__i386) || defined(__amd64) 129 ITOX(j, pt); 130 #else 131 pt[0] = j; 132 #endif 133 if (hx > 0) 134 x = y - (t - x); 135 else 136 x = (-y) - (t + x); 137 a = _TBL_sinl_hi[i]; 138 z = x * x; 139 t = z * (qq1 + z * (qq2 + z * (qq3 + z * (qq4 + z * qq5)))); 140 w = x * (one + z * (pp1 + z * (pp2 + z * (pp3 + z * (pp4 + z * 141 pp5))))); 142 t = _TBL_cosl_hi[i] * w + a * t; 143 t += _TBL_sinl_lo[i]; 144 if (hx < 0) 145 return (-a - t); 146 else 147 return (a + t); 148 } |