Lines Matching +full:range +full:- +full:double
2 * Double-precision scalar sincospi function.
5 * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
16 C2_hi = 4, C2_lo = C2 - C2_hi (~=1.16771278)
21 double poly[10];
24 .poly = { 0x1.921fb54442d184p1, -0x1.2aef39896f94bp0, 0x1.466bc6775ab16p1,
25 -0x1.32d2cce62dc33p-1, 0x1.507834891188ep-4, -0x1.e30750a28c88ep-8,
26 0x1.e8f48308acda4p-12, -0x1.6fc0032b3c29fp-16,
27 0x1.af86ae521260bp-21, -0x1.012a9870eeb7dp-25 },
30 /* Top 12 bits of a double (sign and exponent bits). */
32 abstop12 (double x) in abstop12()
38 -1 or +1 if iy represents half an integer
39 -1 if round(y) is odd.
41 -2 or +2 if iy represents and integer.
42 -2 if iy is odd.
44 The argument is the bit representation of a positive non-zero
45 finite floating-point value which is either a half or an integer. */
52 if (iy & ((1ULL << (0x3ff + 52 - e)) - 1)) in checkint()
54 if ((iy - 1) & 2) in checkint()
55 return -1; in checkint()
59 if (iy & (1 << (0x3ff + 52 - e))) in checkint()
60 return -2; in checkint()
64 /* Approximation for scalar double-precision sincospi(x).
66 sincospif_sin(0x1.3d8a067cd8961p+14) got 0x1.ffe609a279008p-1 want
67 0x1.ffe609a27900cp-1.
69 sincospif_cos(0x1.a0ec6997557eep-24) got 0x1.ffffffffffe59p-1 want
70 0x1.ffffffffffe5dp-1. */
72 arm_math_sincospi (double x, double *out_sin, double *out_cos) in arm_math_sincospi()
79 /* ax = |x| - n (range reduction into -1/2 .. 1/2). */ in arm_math_sincospi()
80 double ar_s = x - rint (x); in arm_math_sincospi()
82 /* We know that cospi(x) = sinpi(0.5 - x) in arm_math_sincospi()
83 range reduction and offset into sinpi range -1/2 .. 1/2 in arm_math_sincospi()
84 ax = 0.5 - |x - rint(x)|. */ in arm_math_sincospi()
85 double ar_c = 0.5 - fabs (ar_s); in arm_math_sincospi()
88 double ar2_s = ar_s * ar_s; in arm_math_sincospi()
89 double ar2_c = ar_c * ar_c; in arm_math_sincospi()
90 double ar4_s = ar2_s * ar2_s; in arm_math_sincospi()
91 double ar4_c = ar2_c * ar2_c; in arm_math_sincospi()
98 double ss = pw_horner_9_f64 (ar2_s, ar4_s, d->poly); in arm_math_sincospi()
99 double cc = pw_horner_9_f64 (ar2_c, ar4_c, d->poly); in arm_math_sincospi()
101 /* As all values are reduced to -1/2 .. 1/2, the result of cos(x) in arm_math_sincospi()
106 = asdouble (asuint64 (fma (-4 * ar2_s, ar_s, ss * ar_s)) ^ ss_sign); in arm_math_sincospi()
108 = asdouble (asuint64 (fma (-4 * ar2_c, ar_c, cc * ar_c)) ^ cc_sign); in arm_math_sincospi()
113 - Half integer (relevant if abs(x) in [0x1p51, 0x1p52]) in arm_math_sincospi()
114 - Odd integer (relevant if abs(x) in [0x1p52, 0x1p53]) in arm_math_sincospi()
115 - Even integer (relevant if abs(x) in [0x1p53, inf]) in arm_math_sincospi()
116 - Inf or NaN. */ in arm_math_sincospi()
119 double inv_result = __math_invalid (x); in arm_math_sincospi()
131 *out_sin = sign ? -m : m; in arm_math_sincospi()
154 SINCOS_INTERVAL (0, 0x1p-63, 10000)
155 SINCOS_INTERVAL (0x1p-63, 0.5, 50000)