Lines Matching +full:abs +full:- +full:range
2 * Double-precision 2^x function.
4 * Copyright (c) 2018-2024, Arm Limited.
5 * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
40 sbits -= 1ull << 52;
45 /* k < 0, need special care in the subnormal range. */
52 range to avoid double rounding that can cause 0.5+E/2 ulp error where
53 E is the worst-case ulp error outside the subnormal range. So this
54 is only useful if the goal is better than 1 ulp worst-case error. */
56 lo = scale - y + scale * tmp;
58 lo = 1.0 - hi + y + lo;
59 y = eval_as_double (hi + lo) - 1.0;
60 /* Avoid -0.0 with downward rounding. */
64 force_eval_double (opt_barrier_double (0x1p-1022) * 0x1p-1022);
66 y = 0x1p-1022 * y;
86 if (unlikely (abstop - top12 (0x1p-54) >= top12 (512.0) - top12 (0x1p-54)))
88 if (abstop - top12 (0x1p-54) >= 0x80000000)
94 if (asuint64 (x) == asuint64 (-INFINITY))
100 else if (asuint64 (x) >= asuint64 (-1075.0))
108 /* exp2(x) = 2^(k/N) * 2^r, with 2^r in [2^(-1/2N),2^(1/2N)]. */
109 /* x = k/N + r, with int k and r in [-1/2N, 1/2N]. */
112 kd -= Shift; /* k/N for int k. */
113 r = x - kd;
116 top = ki << (52 - EXP_TABLE_BITS);
118 /* This is only a valid scale when -1023*N < k < 1024*N. */
120 /* exp2(x) = 2^(k/N) * 2^r ~= scale + scale * (tail + 2^r - 1). */
124 /* Worst case error is less than 0.5+0.86/N+(abs poly error * 2^53) ulp. */
135 /* Note: tmp == 0 or |tmp| > 2^-65 and scale > 2^-928, so there
147 TEST_SIG (S, D, 1, exp2, -9.9, 9.9)
151 TEST_SYM_INTERVAL (exp2, 0x1p-6, 0x1p6, 40000)