Back to index

glibc  2.9
utan.h
Go to the documentation of this file.
00001 /*
00002  * IBM Accurate Mathematical Library
00003  * Written by International Business Machines Corp.
00004  * Copyright (C) 2001 Free Software Foundation, Inc.
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU Lesser General Public License as published by
00008  * the Free Software Foundation; either version 2.1 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program 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
00014  * GNU Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00019  */
00020 
00021 /******************************************************************/
00022 /*                                                                */
00023 /* MODULE_NAME:utan.h                                             */
00024 /*                                                                */
00025 /* common data and variables prototype and definition             */
00026 /******************************************************************/
00027 
00028 #ifndef UTAN_H
00029 #define UTAN_H
00030 
00031 #ifdef BIG_ENDI
00032   static const number
00033   /* polynomial I */
00034  d3             = {{0x3FD55555, 0x55555555} }, /*  0.333... */
00035  d5             = {{0x3FC11111, 0x111107C6} }, /*  0.133... */
00036  d7             = {{0x3FABA1BA, 0x1CDB8745} }, /*    .      */
00037  d9             = {{0x3F9664ED, 0x49CFC666} }, /*    .      */
00038  d11            = {{0x3F82385A, 0x3CF2E4EA} }, /*    .      */
00039   /* polynomial II */
00040  a3             = {{0x3fd55555, 0x55555555} }, /*  1/3      */
00041  aa3            = {{0x3c755555, 0x55555555} }, /*  1/3-a3   */
00042  a5             = {{0x3fc11111, 0x11111111} }, /*  2/15     */
00043  aa5            = {{0x3c411111, 0x11111111} }, /*  2/15-a5  */
00044  a7             = {{0x3faba1ba, 0x1ba1ba1c} }, /*  17/315   */
00045  aa7            = {{0xbc479179, 0x17917918} }, /*   ()-a7   */
00046  a9             = {{0x3f9664f4, 0x882c10fa} }, /*  62/2835  */
00047  aa9            = {{0xbc09a528, 0x8b6c44fd} }, /*   ()-a9   */
00048  a11            = {{0x3f8226e3, 0x55e6c23d} }, /*    .      */
00049  aa11           = {{0xbc2c292b, 0x8f1a2c13} }, /*    .      */
00050  a13            = {{0x3f6d6d3d, 0x0e157de0} }, /*    .      */
00051  aa13           = {{0xbc0280cf, 0xc968d971} }, /*    .      */
00052  a15            = {{0x3f57da36, 0x452b75e3} }, /*    .      */
00053 #if 0
00054  aa15           = {{0xbbf25789, 0xb285d2ed} }, /*    .      */
00055 #endif
00056  a17            = {{0x3f435582, 0x48036744} }, /*    .      */
00057 #if 0
00058  aa17           = {{0x3be488d9, 0x563f1f23} }, /*    .      */
00059 #endif
00060  a19            = {{0x3f2f57d7, 0x734d1664} }, /*    .      */
00061 #if 0
00062  aa19           = {{0x3bb0d55a, 0x913ccb50} }, /*    .      */
00063 #endif
00064  a21            = {{0x3f1967e1, 0x8afcafad} }, /*    .      */
00065 #if 0
00066  aa21           = {{0xbbbd7614, 0xa42d44e6} }, /*    .      */
00067 #endif
00068  a23            = {{0x3f0497d8, 0xeea25259} }, /*    .      */
00069 #if 0
00070  aa23           = {{0x3b99f2d0, 0x2e4d2863} }, /*    .      */
00071 #endif
00072  a25            = {{0x3ef0b132, 0xd39a6050} }, /*    .      */
00073 #if 0
00074  aa25           = {{0x3b93b274, 0xc2c19614} }, /*    .      */
00075 #endif
00076  a27            = {{0x3edb0f72, 0xd3ee24e9} }, /*    .      */
00077 #if 0
00078  aa27           = {{0x3b61688d, 0xdd595609} }, /*    .      */
00079 #endif
00080   /* polynomial III */
00081  e0             = {{0x3FD55555, 0x55554DBD} }, /*    .      */
00082  e1             = {{0x3FC11112, 0xE0A6B45F} }, /*    .      */
00083 
00084   /* constants    */
00085  zero           = {{0x00000000, 0x00000000} }, /* 0         */
00086  one            = {{0x3ff00000, 0x00000000} }, /* 1         */
00087  mone           = {{0xbff00000, 0x00000000} }, /*-1         */
00088  mfftnhf        = {{0xc02f0000, 0x00000000} }, /*-15.5      */
00089  two8           = {{0x40700000, 0x00000000} }, /* 256       */
00090 
00091  g1             = {{0x3e4b096c, 0x00000000} }, /* 1.259e-8  */
00092  g2             = {{0x3faf212d, 0x00000000} }, /* 0.0608    */
00093  g3             = {{0x3fe92f1a, 0x00000000} }, /* 0.787     */
00094  g4             = {{0x40390000, 0x00000000} }, /* 25.0      */
00095  g5             = {{0x4197d784, 0x00000000} }, /* 1e8       */
00096  gy1            = {{0x3e7ad7f2, 0x9abcaf48} }, /* 1e-7      */
00097  gy2            = {{0x3faf212d, 0x00000000} }, /* 0.0608    */
00098 
00099  u1             = {{0x3cc8c33a, 0x00000000} }, /* 6.873e-16 */
00100  u2             = {{0x3983dc4d, 0x00000000} }, /* 1.224e-31 */
00101  u3             = {{0x3c78e14b, 0x00000000} }, /* 2.158e-17 */
00102  ua3            = {{0x3bfd8b58, 0x00000000} }, /* 1.001e-19 */
00103  ub3            = {{0x3cc81898, 0x00000000} }, /* 6.688e-16 */
00104  u4             = {{0x399856c2, 0x00000000} }, /* 3e-31     */
00105  u5             = {{0x3c39d80a, 0x00000000} }, /* 1.401e-18 */
00106  u6             = {{0x3c374c5a, 0x00000000} }, /* 1.263e-18 */
00107  u7             = {{0x39903beb, 0x00000000} }, /* 2.001e-31 */
00108  u8             = {{0x399c56ae, 0x00000000} }, /* 3.493e-31 */
00109  u9             = {{0x3c7d0ac7, 0x00000000} }, /* 2.519e-17 */
00110  ua9            = {{0x3bfd8b58, 0x00000000} }, /* 1.001e-19 */
00111  ub9            = {{0x3ccc2375, 0x00000000} }, /* 7.810e-16 */
00112  u10            = {{0x3c7e40af, 0x00000000} }, /* 2.624e-17 */
00113  ua10           = {{0x3bfd8b58, 0x00000000} }, /* 1.001e-19 */
00114  ub10           = {{0x3ccc6405, 0x00000000} }, /* 7.880e-16 */
00115  u11            = {{0x39e509b6, 0x00000000} }, /* 8.298e-30 */
00116  u12            = {{0x39e509b6, 0x00000000} }, /* 8.298e-30 */
00117  u13            = {{0x3c39d80a, 0x00000000} }, /* 1.401e-18 */
00118  u14            = {{0x3c374c5a, 0x00000000} }, /* 1.263e-18 */
00119  u15            = {{0x3ab5767a, 0x00000000} }, /* 6.935e-26 */
00120  u16            = {{0x3ab57744, 0x00000000} }, /* 6.936e-26 */
00121  u17            = {{0x3c7d0ac7, 0x00000000} }, /* 2.519e-17 */
00122  ua17           = {{0x3bfdb11f, 0x00000000} }, /* 1.006e-19 */
00123  ub17           = {{0x3ccc2375, 0x00000000} }, /* 7.810e-16 */
00124  u18            = {{0x3c7e40af, 0x00000000} }, /* 2.624e-17 */
00125  ua18           = {{0x3bfdb11f, 0x00000000} }, /* 1.006e-19 */
00126  ub18           = {{0x3ccc6405, 0x00000000} }, /* 7.880e-16 */
00127  u19            = {{0x39a13b61, 0x00000000} }, /* 4.248e-31 */
00128  u20            = {{0x39a13b61, 0x00000000} }, /* 4.248e-31 */
00129  u21            = {{0x3c3bb9b8, 0x00000000} }, /* 1.503e-18 */
00130  u22            = {{0x3c392e08, 0x00000000} }, /* 1.365e-18 */
00131  u23            = {{0x3a0ce706, 0x00000000} }, /* 4.560e-29 */
00132  u24            = {{0x3a0cff5d, 0x00000000} }, /* 4.575e-29 */
00133  u25            = {{0x3c7d0ac7, 0x00000000} }, /* 2.519e-17 */
00134  ua25           = {{0x3bfd8b58, 0x00000000} }, /* 1.001e-19 */
00135  ub25           = {{0x3ccc2375, 0x00000000} }, /* 7.810e-16 */
00136  u26            = {{0x3c7e40af, 0x00000000} }, /* 2.624e-17 */
00137  ua26           = {{0x3bfd8b58, 0x00000000} }, /* 1.001e-19 */
00138  ub26           = {{0x3ccc6405, 0x00000000} }, /* 7.880e-16 */
00139  u27            = {{0x3ad421cb, 0x00000000} }, /* 2.602e-25 */
00140  u28            = {{0x3ad421cb, 0x00000000} }, /* 2.602e-25 */
00141 
00142             mp1 = {{0x3FF921FB, 0x58000000} },
00143             mp2 = {{0xBE4DDE97, 0x3C000000} },
00144             mp3 = {{0xBC8CB3B3, 0x99D747F2} },
00145             pp3 = {{0xBC8CB3B3, 0x98000000} },
00146             pp4 = {{0xbacd747f, 0x23e32ed7} },
00147           hpinv = {{0x3FE45F30, 0x6DC9C883} },
00148           toint = {{0x43380000, 0x00000000} };
00149 
00150 #else
00151 #ifdef LITTLE_ENDI
00152 
00153   static const number
00154   /* polynomial I */
00155  d3             = {{0x55555555, 0x3FD55555} }, /*  0.333... */
00156  d5             = {{0x111107C6, 0x3FC11111} }, /*  0.133... */
00157  d7             = {{0x1CDB8745, 0x3FABA1BA} }, /*    .      */
00158  d9             = {{0x49CFC666, 0x3F9664ED} }, /*    .      */
00159  d11            = {{0x3CF2E4EA, 0x3F82385A} }, /*    .      */
00160   /* polynomial II */
00161  a3             = {{0x55555555, 0x3fd55555} }, /*  1/3      */
00162  aa3            = {{0x55555555, 0x3c755555} }, /*  1/3-a3   */
00163  a5             = {{0x11111111, 0x3fc11111} }, /*  2/15     */
00164  aa5            = {{0x11111111, 0x3c411111} }, /*  2/15-a5  */
00165  a7             = {{0x1ba1ba1c, 0x3faba1ba} }, /*  17/315   */
00166  aa7            = {{0x17917918, 0xbc479179} }, /*   ()-a7   */
00167  a9             = {{0x882c10fa, 0x3f9664f4} }, /*  62/2835  */
00168  aa9            = {{0x8b6c44fd, 0xbc09a528} }, /*   ()-a9   */
00169  a11            = {{0x55e6c23d, 0x3f8226e3} }, /*    .      */
00170  aa11           = {{0x8f1a2c13, 0xbc2c292b} }, /*    .      */
00171  a13            = {{0x0e157de0, 0x3f6d6d3d} }, /*    .      */
00172  aa13           = {{0xc968d971, 0xbc0280cf} }, /*    .      */
00173  a15            = {{0x452b75e3, 0x3f57da36} }, /*    .      */
00174 #if 0
00175  aa15           = {{0xb285d2ed, 0xbbf25789} }, /*    .      */
00176 #endif
00177  a17            = {{0x48036744, 0x3f435582} }, /*    .      */
00178 #if 0
00179  aa17           = {{0x563f1f23, 0x3be488d9} }, /*    .      */
00180 #endif
00181  a19            = {{0x734d1664, 0x3f2f57d7} }, /*    .      */
00182 #if 0
00183  aa19           = {{0x913ccb50, 0x3bb0d55a} }, /*    .      */
00184 #endif
00185  a21            = {{0x8afcafad, 0x3f1967e1} }, /*    .      */
00186 #if 0
00187  aa21           = {{0xa42d44e6, 0xbbbd7614} }, /*    .      */
00188 #endif
00189  a23            = {{0xeea25259, 0x3f0497d8} }, /*    .      */
00190 #if 0
00191  aa23           = {{0x2e4d2863, 0x3b99f2d0} }, /*    .      */
00192 #endif
00193  a25            = {{0xd39a6050, 0x3ef0b132} }, /*    .      */
00194 #if 0
00195  aa25           = {{0xc2c19614, 0x3b93b274} }, /*    .      */
00196 #endif
00197  a27            = {{0xd3ee24e9, 0x3edb0f72} }, /*    .      */
00198 #if 0
00199  aa27           = {{0xdd595609, 0x3b61688d} }, /*    .      */
00200 #endif
00201   /* polynomial III */
00202  e0             = {{0x55554DBD, 0x3FD55555} }, /*    .      */
00203  e1             = {{0xE0A6B45F, 0x3FC11112} }, /*    .      */
00204 
00205   /* constants    */
00206  zero           = {{0x00000000, 0x00000000} }, /* 0         */
00207  one            = {{0x00000000, 0x3ff00000} }, /* 1         */
00208  mone           = {{0x00000000, 0xbff00000} }, /*-1         */
00209  mfftnhf        = {{0x00000000, 0xc02f0000} }, /*-15.5      */
00210  two8           = {{0x00000000, 0x40700000} }, /* 256       */
00211 
00212  g1             = {{0x00000000, 0x3e4b096c} }, /* 1.259e-8  */
00213  g2             = {{0x00000000, 0x3faf212d} }, /* 0.0608    */
00214  g3             = {{0x00000000, 0x3fe92f1a} }, /* 0.787     */
00215  g4             = {{0x00000000, 0x40390000} }, /* 25.0      */
00216  g5             = {{0x00000000, 0x4197d784} }, /* 1e8       */
00217  gy1            = {{0x9abcaf48, 0x3e7ad7f2} }, /* 1e-7      */
00218  gy2            = {{0x00000000, 0x3faf212d} }, /* 0.0608    */
00219 
00220  u1             = {{0x00000000, 0x3cc8c33a} }, /* 6.873e-16 */
00221  u2             = {{0x00000000, 0x3983dc4d} }, /* 1.224e-31 */
00222  u3             = {{0x00000000, 0x3c78e14b} }, /* 2.158e-17 */
00223  ua3            = {{0x00000000, 0x3bfd8b58} }, /* 1.001e-19 */
00224  ub3            = {{0x00000000, 0x3cc81898} }, /* 6.688e-16 */
00225  u4             = {{0x00000000, 0x399856c2} }, /* 3e-31     */
00226  u5             = {{0x00000000, 0x3c39d80a} }, /* 1.401e-18 */
00227  u6             = {{0x00000000, 0x3c374c5a} }, /* 1.263e-18 */
00228  u7             = {{0x00000000, 0x39903beb} }, /* 2.001e-31 */
00229  u8             = {{0x00000000, 0x399c56ae} }, /* 3.493e-31 */
00230  u9             = {{0x00000000, 0x3c7d0ac7} }, /* 2.519e-17 */
00231  ua9            = {{0x00000000, 0x3bfd8b58} }, /* 1.001e-19 */
00232  ub9            = {{0x00000000, 0x3ccc2375} }, /* 7.810e-16 */
00233  u10            = {{0x00000000, 0x3c7e40af} }, /* 2.624e-17 */
00234  ua10           = {{0x00000000, 0x3bfd8b58} }, /* 1.001e-19 */
00235  ub10           = {{0x00000000, 0x3ccc6405} }, /* 7.880e-16 */
00236  u11            = {{0x00000000, 0x39e509b6} }, /* 8.298e-30 */
00237  u12            = {{0x00000000, 0x39e509b6} }, /* 8.298e-30 */
00238  u13            = {{0x00000000, 0x3c39d80a} }, /* 1.401e-18 */
00239  u14            = {{0x00000000, 0x3c374c5a} }, /* 1.263e-18 */
00240  u15            = {{0x00000000, 0x3ab5767a} }, /* 6.935e-26 */
00241  u16            = {{0x00000000, 0x3ab57744} }, /* 6.936e-26 */
00242  u17            = {{0x00000000, 0x3c7d0ac7} }, /* 2.519e-17 */
00243  ua17           = {{0x00000000, 0x3bfdb11f} }, /* 1.006e-19 */
00244  ub17           = {{0x00000000, 0x3ccc2375} }, /* 7.810e-16 */
00245  u18            = {{0x00000000, 0x3c7e40af} }, /* 2.624e-17 */
00246  ua18           = {{0x00000000, 0x3bfdb11f} }, /* 1.006e-19 */
00247  ub18           = {{0x00000000, 0x3ccc6405} }, /* 7.880e-16 */
00248  u19            = {{0x00000000, 0x39a13b61} }, /* 4.248e-31 */
00249  u20            = {{0x00000000, 0x39a13b61} }, /* 4.248e-31 */
00250  u21            = {{0x00000000, 0x3c3bb9b8} }, /* 1.503e-18 */
00251  u22            = {{0x00000000, 0x3c392e08} }, /* 1.365e-18 */
00252  u23            = {{0x00000000, 0x3a0ce706} }, /* 4.560e-29 */
00253  u24            = {{0x00000000, 0x3a0cff5d} }, /* 4.575e-29 */
00254  u25            = {{0x00000000, 0x3c7d0ac7} }, /* 2.519e-17 */
00255  ua25           = {{0x00000000, 0x3bfd8b58} }, /* 1.001e-19 */
00256  ub25           = {{0x00000000, 0x3ccc2375} }, /* 7.810e-16 */
00257  u26            = {{0x00000000, 0x3c7e40af} }, /* 2.624e-17 */
00258  ua26           = {{0x00000000, 0x3bfd8b58} }, /* 1.001e-19 */
00259  ub26           = {{0x00000000, 0x3ccc6405} }, /* 7.880e-16 */
00260  u27            = {{0x00000000, 0x3ad421cb} }, /* 2.602e-25 */
00261  u28            = {{0x00000000, 0x3ad421cb} }, /* 2.602e-25 */
00262 
00263             mp1 = {{0x58000000, 0x3FF921FB} },
00264             mp2 = {{0x3C000000, 0xBE4DDE97} },
00265             mp3 = {{0x99D747F2, 0xBC8CB3B3} },
00266             pp3 = {{0x98000000, 0xBC8CB3B3} },
00267             pp4 = {{0x23e32ed7, 0xbacd747f} },
00268           hpinv = {{0x6DC9C883, 0x3FE45F30} },
00269           toint = {{0x00000000, 0x43380000} };
00270 
00271 #endif
00272 #endif
00273 
00274 
00275 #define  ZERO      zero.d
00276 #define  ONE       one.d
00277 #define  MONE      mone.d
00278 #define  TWO8      two8.d
00279 
00280 #endif