1 | /* Shared data between expf, exp2f and powf. |
---|
2 | Copyright (c) 2017 ARM Ltd. All rights reserved. |
---|
3 | |
---|
4 | Redistribution and use in source and binary forms, with or without |
---|
5 | modification, are permitted provided that the following conditions |
---|
6 | are met: |
---|
7 | 1. Redistributions of source code must retain the above copyright |
---|
8 | notice, this list of conditions and the following disclaimer. |
---|
9 | 2. Redistributions in binary form must reproduce the above copyright |
---|
10 | notice, this list of conditions and the following disclaimer in the |
---|
11 | documentation and/or other materials provided with the distribution. |
---|
12 | 3. The name of the company may not be used to endorse or promote |
---|
13 | products derived from this software without specific prior written |
---|
14 | permission. |
---|
15 | |
---|
16 | THIS SOFTWARE IS PROVIDED BY ARM LTD ``AS IS AND ANY EXPRESS OR IMPLIED |
---|
17 | WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
---|
18 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
---|
19 | IN NO EVENT SHALL ARM LTD BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
---|
20 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED |
---|
21 | TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
---|
22 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
---|
23 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
---|
24 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
---|
25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ |
---|
26 | |
---|
27 | #include "fdlibm.h" |
---|
28 | #if !__OBSOLETE_MATH |
---|
29 | |
---|
30 | #include "math_config.h" |
---|
31 | |
---|
32 | #define N (1 << EXP2F_TABLE_BITS) |
---|
33 | |
---|
34 | const struct exp2f_data __exp2f_data = { |
---|
35 | /* tab[i] = uint(2^(i/N)) - (i << 52-BITS) |
---|
36 | used for computing 2^(k/N) for an int |k| < 150 N as |
---|
37 | double(tab[k%N] + (k << 52-BITS)) */ |
---|
38 | .tab = { |
---|
39 | 0x3ff0000000000000, 0x3fefd9b0d3158574, 0x3fefb5586cf9890f, 0x3fef9301d0125b51, |
---|
40 | 0x3fef72b83c7d517b, 0x3fef54873168b9aa, 0x3fef387a6e756238, 0x3fef1e9df51fdee1, |
---|
41 | 0x3fef06fe0a31b715, 0x3feef1a7373aa9cb, 0x3feedea64c123422, 0x3feece086061892d, |
---|
42 | 0x3feebfdad5362a27, 0x3feeb42b569d4f82, 0x3feeab07dd485429, 0x3feea47eb03a5585, |
---|
43 | 0x3feea09e667f3bcd, 0x3fee9f75e8ec5f74, 0x3feea11473eb0187, 0x3feea589994cce13, |
---|
44 | 0x3feeace5422aa0db, 0x3feeb737b0cdc5e5, 0x3feec49182a3f090, 0x3feed503b23e255d, |
---|
45 | 0x3feee89f995ad3ad, 0x3feeff76f2fb5e47, 0x3fef199bdd85529c, 0x3fef3720dcef9069, |
---|
46 | 0x3fef5818dcfba487, 0x3fef7c97337b9b5f, 0x3fefa4afa2a490da, 0x3fefd0765b6e4540, |
---|
47 | }, |
---|
48 | .shift_scaled = 0x1.8p+52 / N, |
---|
49 | .poly = { 0x1.c6af84b912394p-5, 0x1.ebfce50fac4f3p-3, 0x1.62e42ff0c52d6p-1 }, |
---|
50 | .shift = 0x1.8p+52, |
---|
51 | .invln2_scaled = 0x1.71547652b82fep+0 * N, |
---|
52 | .poly_scaled = { |
---|
53 | 0x1.c6af84b912394p-5/N/N/N, 0x1.ebfce50fac4f3p-3/N/N, 0x1.62e42ff0c52d6p-1/N |
---|
54 | }, |
---|
55 | }; |
---|
56 | #endif /* !__OBSOLETE_MATH */ |
---|