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

2  * Double-precision e^x function.
4 * Copyright (c) 2018-2024, Arm Limited.
5 * SPDX-License-Identifier: MIT OR Apache-2.0 WITH LLVM-exception
22 #define C2 __exp_data.poly[5 - EXP_POLY_ORDER]
23 #define C3 __exp_data.poly[6 - EXP_POLY_ORDER]
24 #define C4 __exp_data.poly[7 - EXP_POLY_ORDER]
25 #define C5 __exp_data.poly[8 - EXP_POLY_ORDER]
26 #define C6 __exp_data.poly[9 - EXP_POLY_ORDER]
32 a double. (int32_t)KI is the k used in the argument reduction and exponent
35 static inline double
43 sbits -= 1009ull << 52; in exp_inline_special_case()
48 /* k < 0, need special care in the subnormal range. */ in exp_inline_special_case()
55 range to avoid double rounding that can cause 0.5+E/2 ulp error where in exp_inline_special_case()
56 E is the worst-case ulp error outside the subnormal range. So this in exp_inline_special_case()
57 is only useful if the goal is better than 1 ulp worst-case error. */ in exp_inline_special_case()
59 lo = scale - y + scale * tmp; in exp_inline_special_case()
61 lo = 1.0 - hi + y + lo; in exp_inline_special_case()
62 y = eval_as_double (hi + lo) - 1.0; in exp_inline_special_case()
63 /* Avoid -0.0 with downward rounding. */ in exp_inline_special_case()
67 force_eval_double (opt_barrier_double (0x1p-1022) * 0x1p-1022); in exp_inline_special_case()
69 y = 0x1p-1022 * y; in exp_inline_special_case()
73 /* Top 12 bits of a double (sign and exponent bits). */
75 top12 (double x) in top12()
80 /* Computes exp(x+xtail) where |xtail| < 2^-8/N and |xtail| <= |x|.
82 static inline double
83 exp_inline (double x, double xtail) in exp_inline()
91 if (unlikely (abstop - top12 (0x1p-54) >= top12 (512.0) - top12 (0x1p-54))) in exp_inline()
93 if (abstop - top12 (0x1p-54) >= 0x80000000) in exp_inline()
99 if (asuint64 (x) == asuint64 (-INFINITY)) in exp_inline()
112 /* exp(x) = 2^(k/N) * exp(r), with exp(r) in [2^(-1/2N),2^(1/2N)]. */ in exp_inline()
113 /* x = ln2/N*k + r, with int k and r in [-ln2/2N, ln2/2N]. */ in exp_inline()
119 /* z - kd is in [-0.5-2^-16, 0.5] in all rounding modes. */ in exp_inline()
124 /* z - kd is in [-1, 1] in non-nearest rounding modes. */ in exp_inline()
127 kd -= Shift; in exp_inline()
130 /* The code assumes 2^-200 < |xtail| < 2^-8/N. */ in exp_inline()
135 top = ki << (52 - EXP_TABLE_BITS); in exp_inline()
137 /* This is only a valid scale when -1023*N < k < 1024*N. */ in exp_inline()
139 /* exp(x) = 2^(k/N) * exp(r) ~= scale + scale * (tail + exp(r) - 1). */ in exp_inline()
154 /* Note: tmp == 0 or |tmp| > 2^-200 and scale > 2^-739, so there in exp_inline()