Lines Matching +full:high +full:- +full:accuracy
1 /*-
29 * note that tanpi(-x) = -tanpi(x), so the algorithm considers only |x| and
34 * threshold is |x| < 0x1pN with N = -(P/2+M). P is the precision of the
35 * floating-point type and M = 2 to 4. To achieve high accuracy, pi is
36 * decomposed into high and low parts with the high part containing a
37 * number of trailing zero bits. x is also split into high and low parts.
43 * 3. For 1 <= |x| < 0x1p(P-1), argument reduction is required where
49 * tanpi(x) = tan(pi*(j0+r)) = ---------------------------- = tanpi(r)
50 * 1 - tan(pi*j0) * tan(pi*r)
54 * 4. For |x| >= 0x1p(P-1), |x| is integral and tanpi(x) = copysign(0,x).
58 * tanpi(+-0) = +-0
60 * tanpi(n) = -0 for positive odd and negative even integer n.
61 * tanpi(+-n+1/4) = +-1, for positive integers n.
64 * tanpi(n+1/2) = -inf and raises the FE_DIVBYZERO exception for
66 * tanpi(+-inf) = NaN and raises the FE_INVALID exception.
76 pi_lo = -2.7818135228334233e-08; /* 0xbe5dde97 0x3dcb3b3a */
79 * The kernel for tanpi(x) multiplies x by an 80-bit approximation of
89 lo = x - hi; in __kernel_tanpi()
95 x = 0.5 - x; in __kernel_tanpi()
97 lo = x - hi; in __kernel_tanpi()
101 t = - __kernel_tan(hi, lo, -1); in __kernel_tanpi()
122 if (ix < 0x3e200000) { /* |x| < 0x1p-29 */ in tanpi()
132 lo = x * 0x1p53 - hi; in tanpi()
135 return (t * 0x1p-53); in tanpi()
141 t = - __kernel_tanpi(1 - ax); in tanpi()
142 return ((hx & 0x80000000) ? -t : t); in tanpi()
147 odd = (uint64_t)x & 1 ? -1 : 1; in tanpi()
148 ax -= x; in tanpi()
156 t = - __kernel_tanpi(1 - ax); in tanpi()
158 return ((hx & 0x80000000) ? -t : t); in tanpi()
161 /* x = +-inf or nan. */ in tanpi()
167 * or odd integer to set t = +0 or -0. in tanpi()
170 t = ix >= 0x43400000 ? 0 : (copysign(0, (lx & 1) ? -1 : 1)); in tanpi()
171 return ((hx & 0x80000000) ? -t : t); in tanpi()