Back to index

glibc  2.9
t_exp2f.h
Go to the documentation of this file.
00001 /* Accurate tables for exp2f().
00002    Copyright (C) 1998 Free Software Foundation, Inc.
00003    This file is part of the GNU C Library.
00004    Contributed by Geoffrey Keating <geoffk@ozemail.com.au>
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 /* This table has the property that, for all integers -128 <= i <= 127,
00022    exp(i/256.0 + __exp2f_deltatable[i-128]) == __exp2f_atable[i+128] + r
00023    for some -2^-35 < r < 2^-35 (abs(r) < 2^-36 if i <= 0); and that
00024    __exp2f_deltatable[i+128] == t * 2^-30
00025    for integer t so that abs(t) <= 43447 * 2^0.  */
00026 
00027 #define W30 (9.31322575e-10)
00028 static const float __exp2f_deltatable[256] = {
00029       -810*W30,       283*W30,     -1514*W30,      1304*W30,
00030      -1148*W30,       -98*W30,      -744*W30,      -156*W30,
00031       -419*W30,      -155*W30,       474*W30,       167*W30,
00032      -1984*W30,      -826*W30,       692*W30,       781*W30,
00033       -578*W30,      -411*W30,      -129*W30,     -1500*W30,
00034        654*W30,      -141*W30,      -816*W30,       -53*W30,
00035        148*W30,       493*W30,     -2214*W30,       760*W30,
00036        260*W30,       750*W30,     -1300*W30,      1424*W30,
00037      -1445*W30,      -339*W30,      -680*W30,      -349*W30,
00038       -922*W30,       531*W30,       193*W30,     -2892*W30,
00039        290*W30,     -2145*W30,      -276*W30,       485*W30,
00040       -695*W30,       215*W30,     -7093*W30,       412*W30,
00041      -4596*W30,       367*W30,       592*W30,      -615*W30,
00042        -97*W30,     -1066*W30,       972*W30,      -226*W30,
00043       -625*W30,      -374*W30,     -5647*W30,      -180*W30,
00044      20349*W30,      -447*W30,       111*W30,     -4164*W30,
00045        -87*W30,       -21*W30,      -251*W30,        66*W30,
00046       -517*W30,      2093*W30,      -263*W30,       182*W30,
00047       -601*W30,       475*W30,      -483*W30,     -1251*W30,
00048       -373*W30,      1471*W30,       -92*W30,      -215*W30,
00049        -97*W30,      -190*W30,         0*W30,      -290*W30,
00050      -2647*W30,      1940*W30,      -582*W30,        28*W30,
00051        833*W30,      1493*W30,        34*W30,       321*W30,
00052       3327*W30,       -35*W30,       177*W30,      -135*W30,
00053       -796*W30,      -428*W30,       129*W30,      9332*W30,
00054        -12*W30,       -69*W30,     -1743*W30,      6508*W30,
00055        -60*W30,       359*W30,     43447*W30,        15*W30,
00056        -23*W30,      -305*W30,      -375*W30,      -652*W30,
00057        667*W30,       269*W30,     -1575*W30,       185*W30,
00058       -329*W30,       200*W30,      6002*W30,       163*W30,
00059       -647*W30,        19*W30,      -603*W30,      -755*W30,
00060        742*W30,      -438*W30,      3587*W30,      2560*W30,
00061          0*W30,      -520*W30,      -241*W30,      -299*W30,
00062      -1270*W30,      -991*W30,     -1138*W30,       255*W30,
00063      -1192*W30,      1722*W30,      1023*W30,      3700*W30,
00064      -1388*W30,     -1551*W30,     -2549*W30,        27*W30,
00065        282*W30,       673*W30,       113*W30,      1561*W30,
00066         72*W30,       873*W30,        87*W30,      -395*W30,
00067       -433*W30,       629*W30,      3440*W30,      -284*W30,
00068       -592*W30,      -103*W30,       -46*W30,     -3844*W30,
00069       1712*W30,       303*W30,      1555*W30,      -631*W30,
00070      -1400*W30,      -961*W30,      -854*W30,      -276*W30,
00071        407*W30,       833*W30,      -345*W30,     -1501*W30,
00072        121*W30,     -1581*W30,       400*W30,       150*W30,
00073       1224*W30,      -139*W30,      -563*W30,       879*W30,
00074        933*W30,      2939*W30,       788*W30,       211*W30,
00075        530*W30,      -192*W30,       706*W30,    -13347*W30,
00076       1065*W30,         3*W30,       111*W30,      -208*W30,
00077       -360*W30,      -532*W30,      -291*W30,       483*W30,
00078        987*W30,       -33*W30,     -1373*W30,      -166*W30,
00079      -1174*W30,     -3955*W30,      1601*W30,      -280*W30,
00080       1405*W30,       600*W30,     -1659*W30,       -23*W30,
00081        390*W30,       449*W30,       570*W30,    -13143*W30,
00082         -9*W30,     -1646*W30,      1201*W30,       294*W30,
00083       2181*W30,     -1173*W30,      1388*W30,     -4504*W30,
00084        190*W30,     -2304*W30,       211*W30,       239*W30,
00085         48*W30,      -817*W30,      1018*W30,      1828*W30,
00086       -663*W30,      1408*W30,       408*W30,       -36*W30,
00087       1295*W30,      -230*W30,      1341*W30,         9*W30,
00088         40*W30,       705*W30,       186*W30,       376*W30,
00089        557*W30,      5866*W30,       363*W30,     -1558*W30,
00090        718*W30,       669*W30,      1369*W30,     -2972*W30,
00091       -468*W30,      -121*W30,      -219*W30,       667*W30,
00092      29954*W30,       366*W30,        48*W30,      -203*W30
00093 };
00094 
00095 static const float __exp2f_atable[256] /* __attribute__((mode(SF))) */ = {
00096  0.707106411447, /* 0x0.b504ecfff */
00097  0.709024071690, /* 0x0.b58299fff */
00098  0.710945606239, /* 0x0.b60088000 */
00099  0.712874472142, /* 0x0.b67ef1000 */
00100  0.714806139464, /* 0x0.b6fd88fff */
00101  0.716744661340, /* 0x0.b77c94000 */
00102  0.718687653549, /* 0x0.b7fbea000 */
00103  0.720636486992, /* 0x0.b87ba1fff */
00104  0.722590208040, /* 0x0.b8fbabfff */
00105  0.724549472323, /* 0x0.b97c12fff */
00106  0.726514220228, /* 0x0.b9fcd5fff */
00107  0.728483855735, /* 0x0.ba7deb000 */
00108  0.730457961549, /* 0x0.baff4afff */
00109  0.732438981522, /* 0x0.bb811efff */
00110  0.734425544748, /* 0x0.bc0350000 */
00111  0.736416816713, /* 0x0.bc85d0000 */
00112  0.738412797450, /* 0x0.bd089efff */
00113  0.740414917465, /* 0x0.bd8bd4fff */
00114  0.742422521111, /* 0x0.be0f66fff */
00115  0.744434773914, /* 0x0.be9346fff */
00116  0.746454179287, /* 0x0.bf179f000 */
00117  0.748477637755, /* 0x0.bf9c3afff */
00118  0.750506639473, /* 0x0.c02133fff */
00119  0.752541840064, /* 0x0.c0a694fff */
00120  0.754582285889, /* 0x0.c12c4e000 */
00121  0.756628334525, /* 0x0.c1b265000 */
00122  0.758678436269, /* 0x0.c238bffff */
00123  0.760736882681, /* 0x0.c2bfa6fff */
00124  0.762799203401, /* 0x0.c346cf000 */
00125  0.764867603790, /* 0x0.c3ce5d000 */
00126  0.766940355298, /* 0x0.c45633fff */
00127  0.769021093841, /* 0x0.c4de90fff */
00128  0.771104693409, /* 0x0.c5671dfff */
00129  0.773195922364, /* 0x0.c5f02afff */
00130  0.775292098512, /* 0x0.c6798afff */
00131  0.777394294745, /* 0x0.c70350000 */
00132  0.779501736166, /* 0x0.c78d6d000 */
00133  0.781615912910, /* 0x0.c817fafff */
00134  0.783734917628, /* 0x0.c8a2d9fff */
00135  0.785858273516, /* 0x0.c92e02000 */
00136  0.787990570071, /* 0x0.c9b9c0000 */
00137  0.790125787245, /* 0x0.ca45aefff */
00138  0.792268991467, /* 0x0.cad223fff */
00139  0.794417440881, /* 0x0.cb5ef0fff */
00140  0.796570718287, /* 0x0.cbec0efff */
00141  0.798730909811, /* 0x0.cc79a0fff */
00142  0.800892710672, /* 0x0.cd074dfff */
00143  0.803068041795, /* 0x0.cd95ddfff */
00144  0.805242776881, /* 0x0.ce2464000 */
00145  0.807428598393, /* 0x0.ceb3a3fff */
00146  0.809617877002, /* 0x0.cf431dfff */
00147  0.811812341211, /* 0x0.cfd2eefff */
00148  0.814013659956, /* 0x0.d06333000 */
00149  0.816220164311, /* 0x0.d0f3ce000 */
00150  0.818434238424, /* 0x0.d184e7fff */
00151  0.820652604094, /* 0x0.d21649fff */
00152  0.822877407074, /* 0x0.d2a818000 */
00153  0.825108587751, /* 0x0.d33a51000 */
00154  0.827342867839, /* 0x0.d3ccbdfff */
00155  0.829588949684, /* 0x0.d45ff1000 */
00156  0.831849217401, /* 0x0.d4f411fff */
00157  0.834093391880, /* 0x0.d58724fff */
00158  0.836355149750, /* 0x0.d61b5f000 */
00159  0.838620424257, /* 0x0.d6afd3fff */
00160  0.840896368027, /* 0x0.d744fc000 */
00161  0.843176305293, /* 0x0.d7da66fff */
00162  0.845462262643, /* 0x0.d87037000 */
00163  0.847754716864, /* 0x0.d90673fff */
00164  0.850052893157, /* 0x0.d99d10fff */
00165  0.852359056469, /* 0x0.da3433fff */
00166  0.854668736446, /* 0x0.dacb91fff */
00167  0.856986224651, /* 0x0.db6373000 */
00168  0.859309315673, /* 0x0.dbfbb1fff */
00169  0.861639738080, /* 0x0.dc946bfff */
00170  0.863975346095, /* 0x0.dd2d7d000 */
00171  0.866317391394, /* 0x0.ddc6f9fff */
00172  0.868666708472, /* 0x0.de60f1000 */
00173  0.871022939695, /* 0x0.defb5c000 */
00174  0.873383641229, /* 0x0.df9611fff */
00175  0.875751554968, /* 0x0.e03141000 */
00176  0.878126025200, /* 0x0.e0ccde000 */
00177  0.880506813521, /* 0x0.e168e4fff */
00178  0.882894217966, /* 0x0.e2055afff */
00179  0.885287821299, /* 0x0.e2a239000 */
00180  0.887686729423, /* 0x0.e33f6ffff */
00181  0.890096127973, /* 0x0.e3dd56fff */
00182  0.892507970338, /* 0x0.e47b67000 */
00183  0.894928157336, /* 0x0.e51a03000 */
00184  0.897355020043, /* 0x0.e5b90efff */
00185  0.899788379682, /* 0x0.e65888000 */
00186  0.902227103705, /* 0x0.e6f85afff */
00187  0.904673457151, /* 0x0.e798ae000 */
00188  0.907128036008, /* 0x0.e8398afff */
00189  0.909585535528, /* 0x0.e8da99000 */
00190  0.912051796915, /* 0x0.e97c3a000 */
00191  0.914524436003, /* 0x0.ea1e46000 */
00192  0.917003571999, /* 0x0.eac0bf000 */
00193  0.919490039339, /* 0x0.eb63b2fff */
00194  0.921983361257, /* 0x0.ec071a000 */
00195  0.924488604054, /* 0x0.ecab48fff */
00196  0.926989555360, /* 0x0.ed4f30000 */
00197  0.929502844812, /* 0x0.edf3e6000 */
00198  0.932021975503, /* 0x0.ee98fdfff */
00199  0.934553921208, /* 0x0.ef3eecfff */
00200  0.937083780759, /* 0x0.efe4b8fff */
00201  0.939624726786, /* 0x0.f08b3f000 */
00202  0.942198514924, /* 0x0.f133ebfff */
00203  0.944726586343, /* 0x0.f1d99a000 */
00204  0.947287976728, /* 0x0.f28176fff */
00205  0.949856162070, /* 0x0.f329c5fff */
00206  0.952431440345, /* 0x0.f3d28bfff */
00207  0.955013573175, /* 0x0.f47bc5000 */
00208  0.957603693021, /* 0x0.f52584000 */
00209  0.960199773321, /* 0x0.f5cfa7000 */
00210  0.962801992906, /* 0x0.f67a31000 */
00211  0.965413510788, /* 0x0.f72556fff */
00212  0.968030691152, /* 0x0.f7d0dc000 */
00213  0.970655620084, /* 0x0.f87ce2fff */
00214  0.973290979849, /* 0x0.f92998fff */
00215  0.975926160805, /* 0x0.f9d64bfff */
00216  0.978571653370, /* 0x0.fa83ac000 */
00217  0.981225252139, /* 0x0.fb3193fff */
00218  0.983885228626, /* 0x0.fbdfe6fff */
00219  0.986552715296, /* 0x0.fc8eb7fff */
00220  0.989228487027, /* 0x0.fd3e14000 */
00221  0.991909801964, /* 0x0.fdedcd000 */
00222  0.994601726545, /* 0x0.fe9e38000 */
00223  0.997297704209, /* 0x0.ff4ee6fff */
00224  1.000000000000, /* 0x1.000000000 */
00225  1.002710938457, /* 0x1.00b1aa000 */
00226  1.005429744692, /* 0x1.0163d7ffe */
00227  1.008155703526, /* 0x1.02167dffe */
00228  1.010888457284, /* 0x1.02c995fff */
00229  1.013629436498, /* 0x1.037d38000 */
00230  1.016377568250, /* 0x1.043152000 */
00231  1.019134163841, /* 0x1.04e5f9ffe */
00232  1.021896362316, /* 0x1.059b00000 */
00233  1.024668931945, /* 0x1.0650b3ffe */
00234  1.027446627635, /* 0x1.0706be001 */
00235  1.030234098408, /* 0x1.07bd6bffe */
00236  1.033023953416, /* 0x1.087441ffe */
00237  1.035824656494, /* 0x1.092bce000 */
00238  1.038632392900, /* 0x1.09e3d0001 */
00239  1.041450142840, /* 0x1.0a9c79ffe */
00240  1.044273972530, /* 0x1.0b558a001 */
00241  1.047105550795, /* 0x1.0c0f1c001 */
00242  1.049944162390, /* 0x1.0cc924001 */
00243  1.052791833895, /* 0x1.0d83c4001 */
00244  1.055645227426, /* 0x1.0e3ec3fff */
00245  1.058507919326, /* 0x1.0efa60001 */
00246  1.061377286898, /* 0x1.0fb66bfff */
00247  1.064254641510, /* 0x1.1072fdffe */
00248  1.067140102389, /* 0x1.113018000 */
00249  1.070034146304, /* 0x1.11edc1fff */
00250  1.072937250162, /* 0x1.12ac04001 */
00251  1.075843691823, /* 0x1.136a7dfff */
00252  1.078760385496, /* 0x1.1429a3ffe */
00253  1.081685543070, /* 0x1.14e958000 */
00254  1.084618330005, /* 0x1.15a98c000 */
00255  1.087556362176, /* 0x1.166a18001 */
00256  1.090508937863, /* 0x1.172b98001 */
00257  1.093464612954, /* 0x1.17ed4bfff */
00258  1.096430182434, /* 0x1.18afa5ffe */
00259  1.099401354802, /* 0x1.19725e000 */
00260  1.102381587017, /* 0x1.1a35adfff */
00261  1.105370759965, /* 0x1.1af994000 */
00262  1.108367800686, /* 0x1.1bbdfdffe */
00263  1.111373305331, /* 0x1.1c82f6000 */
00264  1.114387035385, /* 0x1.1d4878001 */
00265  1.117408752440, /* 0x1.1e0e7ffff */
00266  1.120437502874, /* 0x1.1ed4fe000 */
00267  1.123474478729, /* 0x1.1f9c06000 */
00268  1.126521706601, /* 0x1.2063ba001 */
00269  1.129574775716, /* 0x1.212bd0001 */
00270  1.132638812065, /* 0x1.21f49e000 */
00271  1.135709524130, /* 0x1.22bddbffe */
00272  1.138789534565, /* 0x1.2387b5fff */
00273  1.141876101508, /* 0x1.2451fe000 */
00274  1.144971728301, /* 0x1.251cddffe */
00275  1.148077130296, /* 0x1.25e861ffe */
00276  1.151189923305, /* 0x1.26b462001 */
00277  1.154312610610, /* 0x1.278107ffe */
00278  1.157440662410, /* 0x1.284e08001 */
00279  1.160578370109, /* 0x1.291baa001 */
00280  1.163725256932, /* 0x1.29e9e6000 */
00281  1.166879892324, /* 0x1.2ab8a3ffe */
00282  1.170044302935, /* 0x1.2b8805fff */
00283  1.173205971694, /* 0x1.2c5739ffe */
00284  1.176397800428, /* 0x1.2d2867ffe */
00285  1.179586529747, /* 0x1.2df962001 */
00286  1.182784795737, /* 0x1.2ecafbffe */
00287  1.185991406414, /* 0x1.2f9d21ffe */
00288  1.189206838636, /* 0x1.306fdc001 */
00289  1.192430973067, /* 0x1.314328000 */
00290  1.195664167430, /* 0x1.32170c001 */
00291  1.198906540890, /* 0x1.32eb8a001 */
00292  1.202157497408, /* 0x1.33c098000 */
00293  1.205416083326, /* 0x1.349625fff */
00294  1.208683252332, /* 0x1.356c43fff */
00295  1.211961269402, /* 0x1.364318001 */
00296  1.215246438983, /* 0x1.371a64000 */
00297  1.218539118740, /* 0x1.37f22dffe */
00298  1.221847295770, /* 0x1.38cafc000 */
00299  1.225158572187, /* 0x1.39a3fdfff */
00300  1.228481650325, /* 0x1.3a7dc5ffe */
00301  1.231811761846, /* 0x1.3b5803fff */
00302  1.235149741144, /* 0x1.3c32c5ffe */
00303  1.238499879811, /* 0x1.3d0e53ffe */
00304  1.241858124726, /* 0x1.3dea69fff */
00305  1.245225191102, /* 0x1.3ec713fff */
00306  1.248601436624, /* 0x1.3fa458000 */
00307  1.251975655584, /* 0x1.40817a001 */
00308  1.255380749731, /* 0x1.4160a2001 */
00309  1.258783102010, /* 0x1.423f9bffe */
00310  1.262198328973, /* 0x1.431f6e000 */
00311  1.265619754780, /* 0x1.43ffa7fff */
00312  1.269052743928, /* 0x1.44e0a4001 */
00313  1.272490739830, /* 0x1.45c1f4000 */
00314  1.275942921659, /* 0x1.46a432001 */
00315  1.279397487615, /* 0x1.478697ffe */
00316  1.282870173427, /* 0x1.486a2dffe */
00317  1.286346316319, /* 0x1.494dfdffe */
00318  1.289836049094, /* 0x1.4a32b2001 */
00319  1.293333172770, /* 0x1.4b17e1ffe */
00320  1.296839594835, /* 0x1.4bfdadfff */
00321  1.300354957560, /* 0x1.4ce40fffe */
00322  1.303882122055, /* 0x1.4dcb38001 */
00323  1.307417988757, /* 0x1.4eb2f1ffe */
00324  1.310960650439, /* 0x1.4f9b1dfff */
00325  1.314516782746, /* 0x1.50842bfff */
00326  1.318079948424, /* 0x1.516daffff */
00327  1.321653246888, /* 0x1.5257de000 */
00328  1.325237751030, /* 0x1.5342c8001 */
00329  1.328829526907, /* 0x1.542e2c000 */
00330  1.332433700535, /* 0x1.551a5fffe */
00331  1.336045145966, /* 0x1.56070dffe */
00332  1.339667558645, /* 0x1.56f473ffe */
00333  1.343300342533, /* 0x1.57e287ffe */
00334  1.346941947961, /* 0x1.58d130001 */
00335  1.350594043714, /* 0x1.59c087ffe */
00336  1.354256033883, /* 0x1.5ab085fff */
00337  1.357932448365, /* 0x1.5ba175ffe */
00338  1.361609339707, /* 0x1.5c926dfff */
00339  1.365299344044, /* 0x1.5d8441ffe */
00340  1.369003057507, /* 0x1.5e76fc001 */
00341  1.372714757920, /* 0x1.5f6a3c000 */
00342  1.376437187179, /* 0x1.605e2fffe */
00343  1.380165219333, /* 0x1.615282001 */
00344  1.383909463864, /* 0x1.6247e3ffe */
00345  1.387661933907, /* 0x1.633dd0000 */
00346  1.391424179060, /* 0x1.64345fffe */
00347  1.395197510706, /* 0x1.652ba9fff */
00348  1.399006724329, /* 0x1.66254dffe */
00349  1.402773022651, /* 0x1.671c22000 */
00350  1.406576037403, /* 0x1.68155dfff */
00351  1.410389423392, /* 0x1.690f48001 */
00352 };