Lines Matching +full:range +full:- +full:double

2  * Double-precision 10^x function.
4 * Copyright (c) 2023-2024, Arm Limited.
5 * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
13 #define IndexMask (N - 1)
15 #define UFlowBound -0x1.5ep+8 /* -350. */
16 #define SmallTop 0x3c6 /* top12(0x1p-57). */
18 #define Thresh 0x41 /* BigTop - SmallTop. */
22 static double
30 sbits -= 1ull << 52; in special_case()
36 /* n < 0, need special care in the subnormal range. */ in special_case()
44 range to avoid double rounding that can cause 0.5+E/2 ulp error where in special_case()
45 E is the worst-case ulp error outside the subnormal range. So this in special_case()
46 is only useful if the goal is better than 1 ulp worst-case error. */ in special_case()
47 double_t lo = scale - y + scale * tmp; in special_case()
49 lo = 1.0 - hi + y + lo; in special_case()
50 y = eval_as_double (hi + lo) - 1.0; in special_case()
51 /* Avoid -0.0 with downward rounding. */ in special_case()
55 force_eval_double (opt_barrier_double (0x1p-1022) * 0x1p-1022); in special_case()
57 y = 0x1p-1022 * y; in special_case()
62 /* Double-precision 10^x approximation. Largest observed error is ~0.513 ULP. */
63 double
64 exp10 (double x) in exp10()
69 if (unlikely (abstop - SmallTop >= Thresh)) in exp10()
71 if (abstop - SmallTop >= 0x80000000) in exp10()
76 return ix == asuint64 (-INFINITY) ? 0.0 : x + 1.0; in exp10()
82 /* Large x is special-cased below. */ in exp10()
96 kd -= Shift; in exp10()
99 /* r = x - k * log10(2), r in [-0.5, 0.5]. */ in exp10()
108 uint64_t e = ki << (52 - EXP_TABLE_BITS); in exp10()
134 TEST_SIG (S, D, 1, exp10, -9.9, 9.9)
137 TEST_SYM_INTERVAL (exp10, 0, 0x1p-47, 5000)
140 TEST_INTERVAL (exp10, -1, UFlowBound, 50000)
142 TEST_INTERVAL (exp10, UFlowBound, -inf, 5000)