| 1 | /* |
| 2 | * IBM Accurate Mathematical Library |
| 3 | * Written by International Business Machines Corp. |
| 4 | * Copyright (C) 2001-2020 Free Software Foundation, Inc. |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or modify |
| 7 | * it under the terms of the GNU Lesser General Public License as published by |
| 8 | * the Free Software Foundation; either version 2.1 of the License, or |
| 9 | * (at your option) any later version. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU Lesser General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU Lesser General Public License |
| 17 | * along with this program; if not, see <https://www.gnu.org/licenses/>. |
| 18 | */ |
| 19 | |
| 20 | /******************************************************************/ |
| 21 | /* */ |
| 22 | /* MODULE_NAME:utan.h */ |
| 23 | /* */ |
| 24 | /* common data and variables prototype and definition */ |
| 25 | /******************************************************************/ |
| 26 | |
| 27 | #ifndef UTAN_H |
| 28 | #define UTAN_H |
| 29 | |
| 30 | #ifdef BIG_ENDI |
| 31 | static const number |
| 32 | /* polynomial I */ |
| 33 | /**/ d3 = {{0x3FD55555, 0x55555555} }, /* 0.333... */ |
| 34 | /**/ d5 = {{0x3FC11111, 0x111107C6} }, /* 0.133... */ |
| 35 | /**/ d7 = {{0x3FABA1BA, 0x1CDB8745} }, /* . */ |
| 36 | /**/ d9 = {{0x3F9664ED, 0x49CFC666} }, /* . */ |
| 37 | /**/ d11 = {{0x3F82385A, 0x3CF2E4EA} }, /* . */ |
| 38 | /* polynomial II */ |
| 39 | /**/ a3 = {{0x3fd55555, 0x55555555} }, /* 1/3 */ |
| 40 | /**/ aa3 = {{0x3c755555, 0x55555555} }, /* 1/3-a3 */ |
| 41 | /**/ a5 = {{0x3fc11111, 0x11111111} }, /* 2/15 */ |
| 42 | /**/ aa5 = {{0x3c411111, 0x11111111} }, /* 2/15-a5 */ |
| 43 | /**/ a7 = {{0x3faba1ba, 0x1ba1ba1c} }, /* 17/315 */ |
| 44 | /**/ aa7 = {{0xbc479179, 0x17917918} }, /* ()-a7 */ |
| 45 | /**/ a9 = {{0x3f9664f4, 0x882c10fa} }, /* 62/2835 */ |
| 46 | /**/ aa9 = {{0xbc09a528, 0x8b6c44fd} }, /* ()-a9 */ |
| 47 | /**/ a11 = {{0x3f8226e3, 0x55e6c23d} }, /* . */ |
| 48 | /**/ aa11 = {{0xbc2c292b, 0x8f1a2c13} }, /* . */ |
| 49 | /**/ a13 = {{0x3f6d6d3d, 0x0e157de0} }, /* . */ |
| 50 | /**/ aa13 = {{0xbc0280cf, 0xc968d971} }, /* . */ |
| 51 | /**/ a15 = {{0x3f57da36, 0x452b75e3} }, /* . */ |
| 52 | #if 0 |
| 53 | /**/ aa15 = {{0xbbf25789, 0xb285d2ed} }, /* . */ |
| 54 | #endif |
| 55 | /**/ a17 = {{0x3f435582, 0x48036744} }, /* . */ |
| 56 | #if 0 |
| 57 | /**/ aa17 = {{0x3be488d9, 0x563f1f23} }, /* . */ |
| 58 | #endif |
| 59 | /**/ a19 = {{0x3f2f57d7, 0x734d1664} }, /* . */ |
| 60 | #if 0 |
| 61 | /**/ aa19 = {{0x3bb0d55a, 0x913ccb50} }, /* . */ |
| 62 | #endif |
| 63 | /**/ a21 = {{0x3f1967e1, 0x8afcafad} }, /* . */ |
| 64 | #if 0 |
| 65 | /**/ aa21 = {{0xbbbd7614, 0xa42d44e6} }, /* . */ |
| 66 | #endif |
| 67 | /**/ a23 = {{0x3f0497d8, 0xeea25259} }, /* . */ |
| 68 | #if 0 |
| 69 | /**/ aa23 = {{0x3b99f2d0, 0x2e4d2863} }, /* . */ |
| 70 | #endif |
| 71 | /**/ a25 = {{0x3ef0b132, 0xd39a6050} }, /* . */ |
| 72 | #if 0 |
| 73 | /**/ aa25 = {{0x3b93b274, 0xc2c19614} }, /* . */ |
| 74 | #endif |
| 75 | /**/ a27 = {{0x3edb0f72, 0xd3ee24e9} }, /* . */ |
| 76 | #if 0 |
| 77 | /**/ aa27 = {{0x3b61688d, 0xdd595609} }, /* . */ |
| 78 | #endif |
| 79 | /* polynomial III */ |
| 80 | /**/ e0 = {{0x3FD55555, 0x55554DBD} }, /* . */ |
| 81 | /**/ e1 = {{0x3FC11112, 0xE0A6B45F} }, /* . */ |
| 82 | |
| 83 | /* constants */ |
| 84 | /**/ mfftnhf = {{0xc02f0000, 0x00000000} }, /*-15.5 */ |
| 85 | |
| 86 | /**/ g1 = {{0x3e4b096c, 0x00000000} }, /* 1.259e-8 */ |
| 87 | /**/ g2 = {{0x3faf212d, 0x00000000} }, /* 0.0608 */ |
| 88 | /**/ g3 = {{0x3fe92f1a, 0x00000000} }, /* 0.787 */ |
| 89 | /**/ g4 = {{0x40390000, 0x00000000} }, /* 25.0 */ |
| 90 | /**/ g5 = {{0x4197d784, 0x00000000} }, /* 1e8 */ |
| 91 | /**/ gy1 = {{0x3e7ad7f2, 0x9abcaf48} }, /* 1e-7 */ |
| 92 | /**/ gy2 = {{0x3faf212d, 0x00000000} }, /* 0.0608 */ |
| 93 | |
| 94 | /**/ u1 = {{0x3cc8c33a, 0x00000000} }, /* 6.873e-16 */ |
| 95 | /**/ u2 = {{0x3983dc4d, 0x00000000} }, /* 1.224e-31 */ |
| 96 | /**/ u3 = {{0x3c78e14b, 0x00000000} }, /* 2.158e-17 */ |
| 97 | /**/ ua3 = {{0x3bfd8b58, 0x00000000} }, /* 1.001e-19 */ |
| 98 | /**/ ub3 = {{0x3cc81898, 0x00000000} }, /* 6.688e-16 */ |
| 99 | /**/ u4 = {{0x399856c2, 0x00000000} }, /* 3e-31 */ |
| 100 | /**/ u5 = {{0x3c39d80a, 0x00000000} }, /* 1.401e-18 */ |
| 101 | /**/ u6 = {{0x3c374c5a, 0x00000000} }, /* 1.263e-18 */ |
| 102 | /**/ u7 = {{0x39903beb, 0x00000000} }, /* 2.001e-31 */ |
| 103 | /**/ u8 = {{0x399c56ae, 0x00000000} }, /* 3.493e-31 */ |
| 104 | /**/ u9 = {{0x3c7d0ac7, 0x00000000} }, /* 2.519e-17 */ |
| 105 | /**/ ua9 = {{0x3bfd8b58, 0x00000000} }, /* 1.001e-19 */ |
| 106 | /**/ ub9 = {{0x3ccc2375, 0x00000000} }, /* 7.810e-16 */ |
| 107 | /**/ u10 = {{0x3c7e40af, 0x00000000} }, /* 2.624e-17 */ |
| 108 | /**/ ua10 = {{0x3bfd8b58, 0x00000000} }, /* 1.001e-19 */ |
| 109 | /**/ ub10 = {{0x3ccc6405, 0x00000000} }, /* 7.880e-16 */ |
| 110 | /**/ u11 = {{0x39e509b6, 0x00000000} }, /* 8.298e-30 */ |
| 111 | /**/ u12 = {{0x39e509b6, 0x00000000} }, /* 8.298e-30 */ |
| 112 | /**/ u13 = {{0x3c39d80a, 0x00000000} }, /* 1.401e-18 */ |
| 113 | /**/ u14 = {{0x3c374c5a, 0x00000000} }, /* 1.263e-18 */ |
| 114 | /**/ u15 = {{0x3ab5767a, 0x00000000} }, /* 6.935e-26 */ |
| 115 | /**/ u16 = {{0x3ab57744, 0x00000000} }, /* 6.936e-26 */ |
| 116 | /**/ u17 = {{0x3c7d0ac7, 0x00000000} }, /* 2.519e-17 */ |
| 117 | /**/ ua17 = {{0x3bfdb11f, 0x00000000} }, /* 1.006e-19 */ |
| 118 | /**/ ub17 = {{0x3ccc2375, 0x00000000} }, /* 7.810e-16 */ |
| 119 | /**/ u18 = {{0x3c7e40af, 0x00000000} }, /* 2.624e-17 */ |
| 120 | /**/ ua18 = {{0x3bfdb11f, 0x00000000} }, /* 1.006e-19 */ |
| 121 | /**/ ub18 = {{0x3ccc6405, 0x00000000} }, /* 7.880e-16 */ |
| 122 | /**/ u19 = {{0x39a13b61, 0x00000000} }, /* 4.248e-31 */ |
| 123 | /**/ u20 = {{0x39a13b61, 0x00000000} }, /* 4.248e-31 */ |
| 124 | /**/ u21 = {{0x3c3bb9b8, 0x00000000} }, /* 1.503e-18 */ |
| 125 | /**/ u22 = {{0x3c392e08, 0x00000000} }, /* 1.365e-18 */ |
| 126 | /**/ u23 = {{0x3a0ce706, 0x00000000} }, /* 4.560e-29 */ |
| 127 | /**/ u24 = {{0x3a0cff5d, 0x00000000} }, /* 4.575e-29 */ |
| 128 | /**/ u25 = {{0x3c7d0ac7, 0x00000000} }, /* 2.519e-17 */ |
| 129 | /**/ ua25 = {{0x3bfd8b58, 0x00000000} }, /* 1.001e-19 */ |
| 130 | /**/ ub25 = {{0x3ccc2375, 0x00000000} }, /* 7.810e-16 */ |
| 131 | /**/ u26 = {{0x3c7e40af, 0x00000000} }, /* 2.624e-17 */ |
| 132 | /**/ ua26 = {{0x3bfd8b58, 0x00000000} }, /* 1.001e-19 */ |
| 133 | /**/ ub26 = {{0x3ccc6405, 0x00000000} }, /* 7.880e-16 */ |
| 134 | /**/ u27 = {{0x3ad421cb, 0x00000000} }, /* 2.602e-25 */ |
| 135 | /**/ u28 = {{0x3ad421cb, 0x00000000} }, /* 2.602e-25 */ |
| 136 | |
| 137 | /**/ mp1 = {{0x3FF921FB, 0x58000000} }, |
| 138 | /**/ mp2 = {{0xBE4DDE97, 0x3C000000} }, |
| 139 | /**/ mp3 = {{0xBC8CB3B3, 0x99D747F2} }, |
| 140 | /**/ pp3 = {{0xBC8CB3B3, 0x98000000} }, |
| 141 | /**/ pp4 = {{0xbacd747f, 0x23e32ed7} }, |
| 142 | /**/ hpinv = {{0x3FE45F30, 0x6DC9C883} }, |
| 143 | /**/ toint = {{0x43380000, 0x00000000} }; |
| 144 | |
| 145 | #else |
| 146 | #ifdef LITTLE_ENDI |
| 147 | |
| 148 | static const number |
| 149 | /* polynomial I */ |
| 150 | /**/ d3 = {{0x55555555, 0x3FD55555} }, /* 0.333... */ |
| 151 | /**/ d5 = {{0x111107C6, 0x3FC11111} }, /* 0.133... */ |
| 152 | /**/ d7 = {{0x1CDB8745, 0x3FABA1BA} }, /* . */ |
| 153 | /**/ d9 = {{0x49CFC666, 0x3F9664ED} }, /* . */ |
| 154 | /**/ d11 = {{0x3CF2E4EA, 0x3F82385A} }, /* . */ |
| 155 | /* polynomial II */ |
| 156 | /**/ a3 = {{0x55555555, 0x3fd55555} }, /* 1/3 */ |
| 157 | /**/ aa3 = {{0x55555555, 0x3c755555} }, /* 1/3-a3 */ |
| 158 | /**/ a5 = {{0x11111111, 0x3fc11111} }, /* 2/15 */ |
| 159 | /**/ aa5 = {{0x11111111, 0x3c411111} }, /* 2/15-a5 */ |
| 160 | /**/ a7 = {{0x1ba1ba1c, 0x3faba1ba} }, /* 17/315 */ |
| 161 | /**/ aa7 = {{0x17917918, 0xbc479179} }, /* ()-a7 */ |
| 162 | /**/ a9 = {{0x882c10fa, 0x3f9664f4} }, /* 62/2835 */ |
| 163 | /**/ aa9 = {{0x8b6c44fd, 0xbc09a528} }, /* ()-a9 */ |
| 164 | /**/ a11 = {{0x55e6c23d, 0x3f8226e3} }, /* . */ |
| 165 | /**/ aa11 = {{0x8f1a2c13, 0xbc2c292b} }, /* . */ |
| 166 | /**/ a13 = {{0x0e157de0, 0x3f6d6d3d} }, /* . */ |
| 167 | /**/ aa13 = {{0xc968d971, 0xbc0280cf} }, /* . */ |
| 168 | /**/ a15 = {{0x452b75e3, 0x3f57da36} }, /* . */ |
| 169 | #if 0 |
| 170 | /**/ aa15 = {{0xb285d2ed, 0xbbf25789} }, /* . */ |
| 171 | #endif |
| 172 | /**/ a17 = {{0x48036744, 0x3f435582} }, /* . */ |
| 173 | #if 0 |
| 174 | /**/ aa17 = {{0x563f1f23, 0x3be488d9} }, /* . */ |
| 175 | #endif |
| 176 | /**/ a19 = {{0x734d1664, 0x3f2f57d7} }, /* . */ |
| 177 | #if 0 |
| 178 | /**/ aa19 = {{0x913ccb50, 0x3bb0d55a} }, /* . */ |
| 179 | #endif |
| 180 | /**/ a21 = {{0x8afcafad, 0x3f1967e1} }, /* . */ |
| 181 | #if 0 |
| 182 | /**/ aa21 = {{0xa42d44e6, 0xbbbd7614} }, /* . */ |
| 183 | #endif |
| 184 | /**/ a23 = {{0xeea25259, 0x3f0497d8} }, /* . */ |
| 185 | #if 0 |
| 186 | /**/ aa23 = {{0x2e4d2863, 0x3b99f2d0} }, /* . */ |
| 187 | #endif |
| 188 | /**/ a25 = {{0xd39a6050, 0x3ef0b132} }, /* . */ |
| 189 | #if 0 |
| 190 | /**/ aa25 = {{0xc2c19614, 0x3b93b274} }, /* . */ |
| 191 | #endif |
| 192 | /**/ a27 = {{0xd3ee24e9, 0x3edb0f72} }, /* . */ |
| 193 | #if 0 |
| 194 | /**/ aa27 = {{0xdd595609, 0x3b61688d} }, /* . */ |
| 195 | #endif |
| 196 | /* polynomial III */ |
| 197 | /**/ e0 = {{0x55554DBD, 0x3FD55555} }, /* . */ |
| 198 | /**/ e1 = {{0xE0A6B45F, 0x3FC11112} }, /* . */ |
| 199 | |
| 200 | /* constants */ |
| 201 | /**/ mfftnhf = {{0x00000000, 0xc02f0000} }, /*-15.5 */ |
| 202 | |
| 203 | /**/ g1 = {{0x00000000, 0x3e4b096c} }, /* 1.259e-8 */ |
| 204 | /**/ g2 = {{0x00000000, 0x3faf212d} }, /* 0.0608 */ |
| 205 | /**/ g3 = {{0x00000000, 0x3fe92f1a} }, /* 0.787 */ |
| 206 | /**/ g4 = {{0x00000000, 0x40390000} }, /* 25.0 */ |
| 207 | /**/ g5 = {{0x00000000, 0x4197d784} }, /* 1e8 */ |
| 208 | /**/ gy1 = {{0x9abcaf48, 0x3e7ad7f2} }, /* 1e-7 */ |
| 209 | /**/ gy2 = {{0x00000000, 0x3faf212d} }, /* 0.0608 */ |
| 210 | |
| 211 | /**/ u1 = {{0x00000000, 0x3cc8c33a} }, /* 6.873e-16 */ |
| 212 | /**/ u2 = {{0x00000000, 0x3983dc4d} }, /* 1.224e-31 */ |
| 213 | /**/ u3 = {{0x00000000, 0x3c78e14b} }, /* 2.158e-17 */ |
| 214 | /**/ ua3 = {{0x00000000, 0x3bfd8b58} }, /* 1.001e-19 */ |
| 215 | /**/ ub3 = {{0x00000000, 0x3cc81898} }, /* 6.688e-16 */ |
| 216 | /**/ u4 = {{0x00000000, 0x399856c2} }, /* 3e-31 */ |
| 217 | /**/ u5 = {{0x00000000, 0x3c39d80a} }, /* 1.401e-18 */ |
| 218 | /**/ u6 = {{0x00000000, 0x3c374c5a} }, /* 1.263e-18 */ |
| 219 | /**/ u7 = {{0x00000000, 0x39903beb} }, /* 2.001e-31 */ |
| 220 | /**/ u8 = {{0x00000000, 0x399c56ae} }, /* 3.493e-31 */ |
| 221 | /**/ u9 = {{0x00000000, 0x3c7d0ac7} }, /* 2.519e-17 */ |
| 222 | /**/ ua9 = {{0x00000000, 0x3bfd8b58} }, /* 1.001e-19 */ |
| 223 | /**/ ub9 = {{0x00000000, 0x3ccc2375} }, /* 7.810e-16 */ |
| 224 | /**/ u10 = {{0x00000000, 0x3c7e40af} }, /* 2.624e-17 */ |
| 225 | /**/ ua10 = {{0x00000000, 0x3bfd8b58} }, /* 1.001e-19 */ |
| 226 | /**/ ub10 = {{0x00000000, 0x3ccc6405} }, /* 7.880e-16 */ |
| 227 | /**/ u11 = {{0x00000000, 0x39e509b6} }, /* 8.298e-30 */ |
| 228 | /**/ u12 = {{0x00000000, 0x39e509b6} }, /* 8.298e-30 */ |
| 229 | /**/ u13 = {{0x00000000, 0x3c39d80a} }, /* 1.401e-18 */ |
| 230 | /**/ u14 = {{0x00000000, 0x3c374c5a} }, /* 1.263e-18 */ |
| 231 | /**/ u15 = {{0x00000000, 0x3ab5767a} }, /* 6.935e-26 */ |
| 232 | /**/ u16 = {{0x00000000, 0x3ab57744} }, /* 6.936e-26 */ |
| 233 | /**/ u17 = {{0x00000000, 0x3c7d0ac7} }, /* 2.519e-17 */ |
| 234 | /**/ ua17 = {{0x00000000, 0x3bfdb11f} }, /* 1.006e-19 */ |
| 235 | /**/ ub17 = {{0x00000000, 0x3ccc2375} }, /* 7.810e-16 */ |
| 236 | /**/ u18 = {{0x00000000, 0x3c7e40af} }, /* 2.624e-17 */ |
| 237 | /**/ ua18 = {{0x00000000, 0x3bfdb11f} }, /* 1.006e-19 */ |
| 238 | /**/ ub18 = {{0x00000000, 0x3ccc6405} }, /* 7.880e-16 */ |
| 239 | /**/ u19 = {{0x00000000, 0x39a13b61} }, /* 4.248e-31 */ |
| 240 | /**/ u20 = {{0x00000000, 0x39a13b61} }, /* 4.248e-31 */ |
| 241 | /**/ u21 = {{0x00000000, 0x3c3bb9b8} }, /* 1.503e-18 */ |
| 242 | /**/ u22 = {{0x00000000, 0x3c392e08} }, /* 1.365e-18 */ |
| 243 | /**/ u23 = {{0x00000000, 0x3a0ce706} }, /* 4.560e-29 */ |
| 244 | /**/ u24 = {{0x00000000, 0x3a0cff5d} }, /* 4.575e-29 */ |
| 245 | /**/ u25 = {{0x00000000, 0x3c7d0ac7} }, /* 2.519e-17 */ |
| 246 | /**/ ua25 = {{0x00000000, 0x3bfd8b58} }, /* 1.001e-19 */ |
| 247 | /**/ ub25 = {{0x00000000, 0x3ccc2375} }, /* 7.810e-16 */ |
| 248 | /**/ u26 = {{0x00000000, 0x3c7e40af} }, /* 2.624e-17 */ |
| 249 | /**/ ua26 = {{0x00000000, 0x3bfd8b58} }, /* 1.001e-19 */ |
| 250 | /**/ ub26 = {{0x00000000, 0x3ccc6405} }, /* 7.880e-16 */ |
| 251 | /**/ u27 = {{0x00000000, 0x3ad421cb} }, /* 2.602e-25 */ |
| 252 | /**/ u28 = {{0x00000000, 0x3ad421cb} }, /* 2.602e-25 */ |
| 253 | |
| 254 | /**/ mp1 = {{0x58000000, 0x3FF921FB} }, |
| 255 | /**/ mp2 = {{0x3C000000, 0xBE4DDE97} }, |
| 256 | /**/ mp3 = {{0x99D747F2, 0xBC8CB3B3} }, |
| 257 | /**/ pp3 = {{0x98000000, 0xBC8CB3B3} }, |
| 258 | /**/ pp4 = {{0x23e32ed7, 0xbacd747f} }, |
| 259 | /**/ hpinv = {{0x6DC9C883, 0x3FE45F30} }, |
| 260 | /**/ toint = {{0x00000000, 0x43380000} }; |
| 261 | |
| 262 | #endif |
| 263 | #endif |
| 264 | |
| 265 | #endif |
| 266 | |