summary refs log tree commit diff
path: root/sysdeps/libm-ieee754/t_exp2f.h
blob: 0f7674cefb2538683623190c0a04994484de9c0f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
/* These values are accurate to 23+9 bits when represented as
   a float.  */
static const float exp2_accuratetable[256] = {
0.70711034541 /* 0x0.b5052f003 */,
0.70903021104 /* 0x0.b58301004 */,
0.71092861900 /* 0x0.b5ff6b006 */,
0.71286851176 /* 0x0.b67e8d006 */,
0.71481245762 /* 0x0.b6fdf3004 */,
0.71673321725 /* 0x0.b77bd4001 */,
0.71868461379 /* 0x0.b7fbb7006 */,
0.72064983853 /* 0x0.b87c82006 */,
0.72258073096 /* 0x0.b8fb0d003 */,
0.72456008199 /* 0x0.b97cc5002 */,
0.72652846578 /* 0x0.b9fdc5002 */,
0.72848570353 /* 0x0.ba7e0a004 */,
0.73046034578 /* 0x0.baff73003 */,
0.73244112730 /* 0x0.bb8143000 */,
0.73443359139 /* 0x0.bc03d7002 */,
0.73646944762 /* 0x0.bc8943000 */,
0.73839598903 /* 0x0.bd0785006 */,
0.74041211608 /* 0x0.bd8ba6002 */,
0.74243509775 /* 0x0.be103a004 */,
0.74444299943 /* 0x0.be93d1004 */,
0.74646854405 /* 0x0.bf1890003 */,
0.74849390993 /* 0x0.bf9d4c006 */,
0.75051373248 /* 0x0.c021ab003 */,
0.75252974037 /* 0x0.c0a5ca002 */,
0.75460278996 /* 0x0.c12da6006 */,
0.75663453342 /* 0x0.c1b2cd001 */,
0.75867807874 /* 0x0.c238ba006 */,
0.76072299481 /* 0x0.c2bebe000 */,
0.76271909478 /* 0x0.c3418f002 */,
0.76482868204 /* 0x0.c3cbd0006 */,
0.76694220311 /* 0x0.c45653004 */,
0.76902121311 /* 0x0.c4de93003 */,
0.77110719688 /* 0x0.c56748005 */,
0.77314376835 /* 0x0.c5ecc0003 */,
0.77531152970 /* 0x0.c67ad1004 */,
0.77739948042 /* 0x0.c703a7005 */,
0.77948719274 /* 0x0.c78c79007 */,
0.78161448246 /* 0x0.c817e3004 */,
0.78381162885 /* 0x0.c8a7e1002 */,
0.78587090971 /* 0x0.c92ed6001 */,
0.78799921275 /* 0x0.c9ba51001 */,
0.79011362800 /* 0x0.ca44e3006 */,
0.79225623615 /* 0x0.cad14e005 */,
0.79441082487 /* 0x0.cb5e82006 */,
0.79654645924 /* 0x0.cbea78003 */,
0.79873132707 /* 0x0.cc79a8001 */,
0.80093026168 /* 0x0.cd09c4005 */,
0.80304825308 /* 0x0.cd9492001 */,
0.80526113516 /* 0x0.ce2598004 */,
0.80742740634 /* 0x0.ceb390002 */,
0.80963188410 /* 0x0.cf4409000 */,
0.81180763254 /* 0x0.cfd2a0006 */,
0.81401169308 /* 0x0.d06312005 */,
0.81622666121 /* 0x0.d0f43b000 */,
0.81843453653 /* 0x0.d184ed005 */,
0.82070738078 /* 0x0.d219e1001 */,
0.82289630179 /* 0x0.d2a955003 */,
0.82509487868 /* 0x0.d3396b000 */,
0.82737630616 /* 0x0.d3ceef007 */,
0.82961845408 /* 0x0.d461e0007 */,
0.83179849386 /* 0x0.d4f0bf000 */,
0.83408612023 /* 0x0.d586ab007 */,
0.83636939536 /* 0x0.d61c4e007 */,
0.83862531186 /* 0x0.d6b026000 */,
0.84094470740 /* 0x0.d74827000 */,
0.84316509971 /* 0x0.d7d9ab006 */,
0.84546715027 /* 0x0.d87089004 */,
0.84781247378 /* 0x0.d90a3d000 */,
0.85004067431 /* 0x0.d99c44007 */,
0.85237431530 /* 0x0.da3534003 */,
0.85468208790 /* 0x0.dacc72000 */,
0.85696077349 /* 0x0.db61c8002 */,
0.85931611062 /* 0x0.dbfc24000 */,
0.86171466122 /* 0x0.dc9955007 */,
0.86397939929 /* 0x0.dd2dc1006 */,
0.86633706098 /* 0x0.ddc844004 */,
0.86868536481 /* 0x0.de622a006 */,
0.87101131681 /* 0x0.defa99002 */,
0.87337517739 /* 0x0.df9584000 */,
0.87576484682 /* 0x0.e03220001 */,
0.87814646969 /* 0x0.e0ce35007 */,
0.88050335648 /* 0x0.e168ab002 */,
0.88291734457 /* 0x0.e206df000 */,
0.88522624975 /* 0x0.e29e30004 */,
0.88768237833 /* 0x0.e33f27003 */,
0.89007008077 /* 0x0.e3dba2001 */,
0.89250904327 /* 0x0.e47b79004 */,
0.89490824949 /* 0x0.e518b5007 */,
0.89735335113 /* 0x0.e5b8f3001 */,
0.89977204799 /* 0x0.e65776000 */,
0.90221023561 /* 0x0.e6f740001 */,
0.90468037137 /* 0x0.e79922006 */,
0.90711551909 /* 0x0.e838b9003 */,
0.90958660844 /* 0x0.e8daab002 */,
0.91205561170 /* 0x0.e97c7a006 */,
0.91451990614 /* 0x0.ea1dfa006 */,
0.91699457179 /* 0x0.eac028007 */,
0.91948717833 /* 0x0.eb6383000 */,
0.92201787240 /* 0x0.ec095d004 */,
0.92446959027 /* 0x0.ecaa0a006 */,
0.92700457577 /* 0x0.ed502c003 */,
0.92946064473 /* 0x0.edf122000 */,
0.93202102187 /* 0x0.ee98ee001 */,
0.93454003345 /* 0x0.ef3e04007 */,
0.93707615143 /* 0x0.efe439004 */,
0.93964391957 /* 0x0.f08c81007 */,
0.94217014323 /* 0x0.f13210007 */,
0.94470518835 /* 0x0.f1d833005 */,
0.94727593667 /* 0x0.f280ad004 */,
0.94985383753 /* 0x0.f3299f002 */,
0.95245110992 /* 0x0.f3d3d6002 */,
0.95500063903 /* 0x0.f47aec004 */,
0.95758175857 /* 0x0.f52414004 */,
0.96018302447 /* 0x0.f5ce8e004 */,
0.96279788024 /* 0x0.f679ec005 */,
0.96541762355 /* 0x0.f7259c002 */,
0.96803289660 /* 0x0.f7d101005 */,
0.97066921004 /* 0x0.f87dc7006 */,
0.97328519823 /* 0x0.f92938001 */,
0.97589331867 /* 0x0.f9d425001 */,
0.97858297827 /* 0x0.fa846a001 */,
0.98121380814 /* 0x0.fb30d4005 */,
0.98389244083 /* 0x0.fbe060002 */,
0.98657202723 /* 0x0.fc8ffc001 */,
0.98919564488 /* 0x0.fd3bed001 */,
0.99194401506 /* 0x0.fdf00b002 */,
0.99460238224 /* 0x0.fe9e43004 */,
0.99728542574 /* 0x0.ff4e19005 */,
1.00000000000 /* 0x1.000000000 */,
1.00271666054 /* 0x1.00b20a003 */,
1.00544095058 /* 0x1.01649400c */,
1.00819313547 /* 0x1.0218f200e */,
1.01089513312 /* 0x1.02ca06007 */,
1.01363527782 /* 0x1.037d9a005 */,
1.01635849497 /* 0x1.04301200e */,
1.01918780808 /* 0x1.04e97e003 */,
1.02182090297 /* 0x1.05960e00a */,
1.02468311789 /* 0x1.0651a2002 */,
1.02744102491 /* 0x1.070660009 */,
1.03019988541 /* 0x1.07bb2e002 */,
1.03300857552 /* 0x1.087340005 */,
1.03580951708 /* 0x1.092ad000b */,
1.03865504271 /* 0x1.09e54c004 */,
1.04145348082 /* 0x1.0a9cb2007 */,
1.04426109801 /* 0x1.0b54b2007 */,
1.04706287389 /* 0x1.0c0c50003 */,
1.04996109020 /* 0x1.0cca40007 */,
1.05282557024 /* 0x1.0d85fa009 */,
1.05564439314 /* 0x1.0e3eb600c */,
1.05850863475 /* 0x1.0efa6c00c */,
1.06137108805 /* 0x1.0fb604001 */,
1.06423723713 /* 0x1.1071da00a */,
1.06716394429 /* 0x1.1131a8003 */,
1.07004547127 /* 0x1.11ee80005 */,
1.07294559497 /* 0x1.12ac9000c */,
1.07586789139 /* 0x1.136c14005 */,
1.07873940478 /* 0x1.142844007 */,
1.08172726651 /* 0x1.14ec1400e */,
1.08459246171 /* 0x1.15a7da008 */,
1.08752059939 /* 0x1.1667c0001 */,
1.09050178536 /* 0x1.172b20005 */,
1.09349620361 /* 0x1.17ef5e00d */,
1.09634935875 /* 0x1.18aa5a00d */,
1.09940552720 /* 0x1.1972a4006 */,
1.10237383858 /* 0x1.1a352c00a */,
1.10530221471 /* 0x1.1af516006 */,
1.10838031771 /* 0x1.1bbed0001 */,
1.11137616648 /* 0x1.1c8326009 */,
1.11441528816 /* 0x1.1d4a5200d */,
1.11741960066 /* 0x1.1e0f3600c */,
1.12044525152 /* 0x1.1ed580003 */,
1.12346303485 /* 0x1.1f9b4600f */,
1.12655401230 /* 0x1.2065d8000 */,
1.12955987463 /* 0x1.212ad6007 */,
1.13263440148 /* 0x1.21f45400b */,
1.13567769541 /* 0x1.22bbc6009 */,
1.13877141483 /* 0x1.238686005 */,
1.14189016826 /* 0x1.2452ea004 */,
1.14495265504 /* 0x1.251b9e00e */,
1.14807951452 /* 0x1.25e88a001 */,
1.15118837366 /* 0x1.26b448006 */,
1.15428590795 /* 0x1.277f4800e */,
1.15744590761 /* 0x1.284e60001 */,
1.16055941596 /* 0x1.291a6c00a */,
1.16371822369 /* 0x1.29e970008 */,
1.16683173193 /* 0x1.2ab57c009 */,
1.17002511035 /* 0x1.2b86c4007 */,
1.17321026344 /* 0x1.2c578200d */,
1.17639815811 /* 0x1.2d286e002 */,
1.17961537856 /* 0x1.2dfb4600c */,
1.18278920671 /* 0x1.2ecb4600e */,
1.18602204342 /* 0x1.2f9f2400d */,
1.18924140952 /* 0x1.30722000f */,
1.19246912021 /* 0x1.3145a800c */,
1.19566547881 /* 0x1.321722007 */,
1.19890022298 /* 0x1.32eb2000e */,
1.20205938816 /* 0x1.33ba2a000 */,
1.20533752458 /* 0x1.34910000b */,
1.20865476136 /* 0x1.356a66003 */,
1.21195018302 /* 0x1.36425e007 */,
1.21525228034 /* 0x1.371ac6007 */,
1.21851313125 /* 0x1.37f07a007 */,
1.22183310988 /* 0x1.38ca0e001 */,
1.22516608253 /* 0x1.39a47c00a */,
1.22848713419 /* 0x1.3a7e2200f */,
1.23174583912 /* 0x1.3b53b2000 */,
1.23522067082 /* 0x1.3c376c008 */,
1.23849928397 /* 0x1.3d0e4a00c */,
1.24181902431 /* 0x1.3de7da00f */,
1.24523758889 /* 0x1.3ec7e4001 */,
1.24859035038 /* 0x1.3fa39e00f */,
1.25193393249 /* 0x1.407ebe00d */,
1.25539278994 /* 0x1.41616c007 */,
1.25880420214 /* 0x1.4240fe004 */,
1.26223969480 /* 0x1.43222400e */,
1.26558542253 /* 0x1.43fd68001 */,
1.26904225354 /* 0x1.44dff4003 */,
1.27251851576 /* 0x1.45c3c600c */,
1.27593302748 /* 0x1.46a38c00f */,
1.27941727649 /* 0x1.4787e4007 */,
1.28286683578 /* 0x1.4869f600d */,
1.28636789342 /* 0x1.494f6800e */,
1.28982734693 /* 0x1.4a3220009 */,
1.29335498813 /* 0x1.4b1950002 */,
1.29684555547 /* 0x1.4bfe1200b */,
1.30039131655 /* 0x1.4ce672009 */,
1.30388665216 /* 0x1.4dcb8400b */,
1.30738770972 /* 0x1.4eb0f6007 */,
1.31095492852 /* 0x1.4f9abe008 */,
1.31452167056 /* 0x1.50847e00f */,
1.31807971017 /* 0x1.516dac00b */,
1.32168746004 /* 0x1.525a1c006 */,
1.32518649117 /* 0x1.533f6c00b */,
1.32884454737 /* 0x1.542f28007 */,
1.33244597914 /* 0x1.551b2e002 */,
1.33601069461 /* 0x1.5604cc007 */,
1.33969032765 /* 0x1.56f5f2000 */,
1.34328985233 /* 0x1.57e1d800d */,
1.34692609319 /* 0x1.58d026006 */,
1.35055744648 /* 0x1.59be22000 */,
1.35424625891 /* 0x1.5aafe200c */,
1.35795569436 /* 0x1.5ba2fc00b */,
1.36158764384 /* 0x1.5c910200e */,
1.36525344864 /* 0x1.5d814000a */,
1.36908590815 /* 0x1.5e7c6a00e */,
1.37272357954 /* 0x1.5f6ad0009 */,
1.37639832498 /* 0x1.605ba4001 */,
1.38020527377 /* 0x1.615522009 */,
1.38388323800 /* 0x1.62462c00b */,
1.38770687583 /* 0x1.6340c2002 */,
1.39144265656 /* 0x1.643596003 */,
1.39518976211 /* 0x1.652b28000 */,
1.39905631551 /* 0x1.66288e006 */,
1.40280294419 /* 0x1.671e18000 */,
1.40661609194 /* 0x1.6817fe00e */,
1.41035604489 /* 0x1.690d18008 */
};
#define S (1.0/8388608.0)  /* 2^-23 */
static const float exp2_deltatable[256] = {
    61*S,   107*S,  -301*S,   -91*S,    98*S,  -194*S,   -57*S,   223*S,
  -162*S,   176*S,   241*S,    32*S,    24*S,    29*S,   138*S,   871*S,
  -280*S,   -49*S,   204*S,   122*S,   238*S,   262*S,   108*S,  -195*S,
   330*S,   103*S,   -23*S,  -215*S, -1269*S,  -610*S,    19*S,    13*S,
    28*S,  -819*S,   298*S,    78*S,  -233*S,   -18*S,  1186*S,   172*S,
   135*S,  -203*S,  -197*S,   -97*S,  -374*S,     8*S,   512*S,  -295*S,
   240*S,   -15*S,   214*S,   -75*S,   -30*S,    88*S,    12*S,   806*S,
   273*S,  -204*S,   445*S,   429*S,  -579*S,  -109*S,   207*S,    38*S,
   695*S,  -161*S,    68*S,   825*S,  -178*S,   233*S,   187*S,  -358*S,
    91*S,  1056*S,    53*S,   265*S,   257*S,  -150*S,  -118*S,   182*S,
   281*S,   -49*S,   317*S,  -844*S,   -80*S,  -339*S,    10*S,  -269*S,
   -16*S,  -208*S,  -226*S,    95*S,  -141*S,    14*S,    52*S,   -61*S,
  -125*S,   -41*S,   454*S,  -176*S,   196*S,  -550*S,   -26*S,  -129*S,
   -99*S,   250*S,   -25*S,  -274*S,  -154*S,   -32*S,   247*S,  -169*S,
  -272*S,  -209*S,   -64*S,    53*S,    25*S,   171*S,   -25*S,  -406*S,
   135*S,  -141*S,    84*S,   231*S,  -396*S,   414*S,    36*S,  -129*S,
     0*S,    65*S,   133*S,   447*S,    70*S,    62*S,  -236*S,   639*S,
  -903*S,   181*S,   -58*S,  -373*S,  -191*S,  -189*S,   244*S,    39*S,
  -147*S,  -488*S,   196*S,   400*S,    -9*S,    15*S,   -70*S,  -201*S,
   267*S,   133*S,   121*S,   270*S,  -240*S,   466*S,  -289*S,  -428*S,
   -66*S,   352*S,  -880*S,    41*S,   -96*S,  -758*S,   130*S,    29*S,
   310*S,   124*S,    81*S,  -135*S,   348*S,  -172*S,   -44*S,  -338*S,
  -183*S,   148*S,  -206*S,    32*S,    -9*S,  -257*S,    61*S,  -196*S,
   -69*S,  -501*S,  -193*S,   -60*S,    12*S,   296*S,    46*S,   311*S,
   349*S,   383*S,    11*S,   -60*S,  -980*S,  -789*S,  -296*S,  -112*S,
    49*S,  -289*S,  -128*S,    72*S,    65*S,  -643*S,   682*S,    -6*S,
  -378*S,   124*S,  -103*S,  -506*S,   116*S,   190*S,   406*S,  -326*S,
   -83*S,   255*S,   -83*S,   152*S,   -30*S,   185*S,   -80*S,   206*S,
    56*S,   332*S,    50*S,  -266*S,   -58*S,    56*S,     1*S,   313*S,
  -458*S,   135*S,   122*S,  -312*S,   206*S,   -89*S,  -141*S,  -325*S,
   -83*S,   253*S,  -190*S,  -419*S,   738*S,    83*S,  -331*S,   328*S,
  -233*S,   391*S,   159*S,   -62*S,   663*S,   261*S,   345*S,  -288*S
};
/* Maximum magnitude in above table: 1269 */
#undef S
#define EXP2_TSIZE 8
#define EXP2_TTOL 9
#define EXP2_FSIZE 23
#define EXP2_FNAME float