lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 1 | /* Entry points to finite-math-only compiler runs. |
| 2 | Copyright (C) 2011-2015 Free Software Foundation, Inc. |
| 3 | This file is part of the GNU C Library. |
| 4 | |
| 5 | The GNU C Library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Lesser General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2.1 of the License, or (at your option) any later version. |
| 9 | |
| 10 | The GNU C Library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Lesser General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Lesser General Public |
| 16 | License along with the GNU C Library; if not, see |
| 17 | <http://www.gnu.org/licenses/>. */ |
| 18 | |
| 19 | #ifndef _MATH_H |
| 20 | # error "Never use <bits/math-finite.h> directly; include <math.h> instead." |
| 21 | #endif |
| 22 | |
| 23 | /* acos. */ |
| 24 | extern double __REDIRECT_NTH (acos, (double), __acos_finite); |
| 25 | extern float __REDIRECT_NTH (acosf, (float), __acosf_finite); |
| 26 | #ifdef __MATH_DECLARE_LDOUBLE |
| 27 | # ifdef __NO_LONG_DOUBLE_MATH |
| 28 | extern long double __REDIRECT_NTH (acosl, (long double), __acos_finite); |
| 29 | # else |
| 30 | extern long double __REDIRECT_NTH (acosl, (long double), __acosl_finite); |
| 31 | # endif |
| 32 | #endif |
| 33 | |
| 34 | #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 |
| 35 | /* acosh. */ |
| 36 | extern double __REDIRECT_NTH (acosh, (double), __acosh_finite); |
| 37 | extern float __REDIRECT_NTH (acoshf, (float), __acoshf_finite); |
| 38 | # ifdef __MATH_DECLARE_LDOUBLE |
| 39 | # ifdef __NO_LONG_DOUBLE_MATH |
| 40 | extern long double __REDIRECT_NTH (acoshl, (long double), __acosh_finite); |
| 41 | # else |
| 42 | extern long double __REDIRECT_NTH (acoshl, (long double), __acoshl_finite); |
| 43 | # endif |
| 44 | # endif |
| 45 | #endif |
| 46 | |
| 47 | /* asin. */ |
| 48 | extern double __REDIRECT_NTH (asin, (double), __asin_finite); |
| 49 | extern float __REDIRECT_NTH (asinf, (float), __asinf_finite); |
| 50 | #ifdef __MATH_DECLARE_LDOUBLE |
| 51 | # ifdef __NO_LONG_DOUBLE_MATH |
| 52 | extern long double __REDIRECT_NTH (asinl, (long double), __asin_finite); |
| 53 | # else |
| 54 | extern long double __REDIRECT_NTH (asinl, (long double), __asinl_finite); |
| 55 | # endif |
| 56 | #endif |
| 57 | |
| 58 | /* atan2. */ |
| 59 | extern double __REDIRECT_NTH (atan2, (double, double), __atan2_finite); |
| 60 | extern float __REDIRECT_NTH (atan2f, (float, float), __atan2f_finite); |
| 61 | #ifdef __MATH_DECLARE_LDOUBLE |
| 62 | # ifdef __NO_LONG_DOUBLE_MATH |
| 63 | extern long double __REDIRECT_NTH (atan2l, (long double, long double), |
| 64 | __atan2_finite); |
| 65 | # else |
| 66 | extern long double __REDIRECT_NTH (atan2l, (long double, long double), |
| 67 | __atan2l_finite); |
| 68 | # endif |
| 69 | #endif |
| 70 | |
| 71 | #if defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99 |
| 72 | /* atanh. */ |
| 73 | extern double __REDIRECT_NTH (atanh, (double), __atanh_finite); |
| 74 | extern float __REDIRECT_NTH (atanhf, (float), __atanhf_finite); |
| 75 | # ifdef __MATH_DECLARE_LDOUBLE |
| 76 | # ifdef __NO_LONG_DOUBLE_MATH |
| 77 | extern long double __REDIRECT_NTH (atanhl, (long double), __atanh_finite); |
| 78 | # else |
| 79 | extern long double __REDIRECT_NTH (atanhl, (long double), __atanhl_finite); |
| 80 | # endif |
| 81 | # endif |
| 82 | #endif |
| 83 | |
| 84 | /* cosh. */ |
| 85 | extern double __REDIRECT_NTH (cosh, (double), __cosh_finite); |
| 86 | extern float __REDIRECT_NTH (coshf, (float), __coshf_finite); |
| 87 | #ifdef __MATH_DECLARE_LDOUBLE |
| 88 | # ifdef __NO_LONG_DOUBLE_MATH |
| 89 | extern long double __REDIRECT_NTH (coshl, (long double), __cosh_finite); |
| 90 | # else |
| 91 | extern long double __REDIRECT_NTH (coshl, (long double), __coshl_finite); |
| 92 | # endif |
| 93 | #endif |
| 94 | |
| 95 | /* exp. */ |
| 96 | extern double __REDIRECT_NTH (exp, (double), __exp_finite); |
| 97 | extern float __REDIRECT_NTH (expf, (float), __expf_finite); |
| 98 | #ifdef __MATH_DECLARE_LDOUBLE |
| 99 | # ifdef __NO_LONG_DOUBLE_MATH |
| 100 | extern long double __REDIRECT_NTH (expl, (long double), __exp_finite); |
| 101 | # else |
| 102 | extern long double __REDIRECT_NTH (expl, (long double), __expl_finite); |
| 103 | # endif |
| 104 | #endif |
| 105 | |
| 106 | #ifdef __USE_GNU |
| 107 | /* exp10. */ |
| 108 | extern double __REDIRECT_NTH (exp10, (double), __exp10_finite); |
| 109 | extern float __REDIRECT_NTH (exp10f, (float), __exp10f_finite); |
| 110 | # ifdef __MATH_DECLARE_LDOUBLE |
| 111 | # ifdef __NO_LONG_DOUBLE_MATH |
| 112 | extern long double __REDIRECT_NTH (exp10l, (long double), __exp10_finite); |
| 113 | # else |
| 114 | extern long double __REDIRECT_NTH (exp10l, (long double), __exp10l_finite); |
| 115 | # endif |
| 116 | # endif |
| 117 | |
| 118 | /* pow10. */ |
| 119 | extern double __REDIRECT_NTH (pow10, (double), __exp10_finite); |
| 120 | extern float __REDIRECT_NTH (pow10f, (float), __exp10f_finite); |
| 121 | # ifdef __MATH_DECLARE_LDOUBLE |
| 122 | # ifdef __NO_LONG_DOUBLE_MATH |
| 123 | extern long double __REDIRECT_NTH (pow10l, (long double), __exp10_finite); |
| 124 | # else |
| 125 | extern long double __REDIRECT_NTH (pow10l, (long double), __exp10l_finite); |
| 126 | # endif |
| 127 | # endif |
| 128 | #endif |
| 129 | |
| 130 | #ifdef __USE_ISOC99 |
| 131 | /* exp2. */ |
| 132 | extern double __REDIRECT_NTH (exp2, (double), __exp2_finite); |
| 133 | extern float __REDIRECT_NTH (exp2f, (float), __exp2f_finite); |
| 134 | # ifdef __MATH_DECLARE_LDOUBLE |
| 135 | # ifdef __NO_LONG_DOUBLE_MATH |
| 136 | extern long double __REDIRECT_NTH (exp2l, (long double), __exp2_finite); |
| 137 | # else |
| 138 | extern long double __REDIRECT_NTH (exp2l, (long double), __exp2l_finite); |
| 139 | # endif |
| 140 | # endif |
| 141 | #endif |
| 142 | |
| 143 | /* fmod. */ |
| 144 | extern double __REDIRECT_NTH (fmod, (double, double), __fmod_finite); |
| 145 | extern float __REDIRECT_NTH (fmodf, (float, float), __fmodf_finite); |
| 146 | #ifdef __MATH_DECLARE_LDOUBLE |
| 147 | # ifdef __NO_LONG_DOUBLE_MATH |
| 148 | extern long double __REDIRECT_NTH (fmodl, (long double, long double), |
| 149 | __fmod_finite); |
| 150 | # else |
| 151 | extern long double __REDIRECT_NTH (fmodl, (long double, long double), |
| 152 | __fmodl_finite); |
| 153 | # endif |
| 154 | #endif |
| 155 | |
| 156 | #ifdef __USE_ISOC99 |
| 157 | /* hypot. */ |
| 158 | extern double __REDIRECT_NTH (hypot, (double, double), __hypot_finite); |
| 159 | extern float __REDIRECT_NTH (hypotf, (float, float), __hypotf_finite); |
| 160 | # ifdef __MATH_DECLARE_LDOUBLE |
| 161 | # ifdef __NO_LONG_DOUBLE_MATH |
| 162 | extern long double __REDIRECT_NTH (hypotl, (long double, long double), |
| 163 | __hypot_finite); |
| 164 | # else |
| 165 | extern long double __REDIRECT_NTH (hypotl, (long double, long double), |
| 166 | __hypotl_finite); |
| 167 | # endif |
| 168 | # endif |
| 169 | #endif |
| 170 | |
| 171 | #if defined __USE_MISC || defined __USE_XOPEN |
| 172 | /* j0. */ |
| 173 | extern double __REDIRECT_NTH (j0, (double), __j0_finite); |
| 174 | extern float __REDIRECT_NTH (j0f, (float), __j0f_finite); |
| 175 | # ifdef __MATH_DECLARE_LDOUBLE |
| 176 | # ifdef __NO_LONG_DOUBLE_MATH |
| 177 | extern long double __REDIRECT_NTH (j0l, (long double), __j0_finite); |
| 178 | # else |
| 179 | extern long double __REDIRECT_NTH (j0l, (long double), __j0l_finite); |
| 180 | # endif |
| 181 | # endif |
| 182 | |
| 183 | /* y0. */ |
| 184 | extern double __REDIRECT_NTH (y0, (double), __y0_finite); |
| 185 | extern float __REDIRECT_NTH (y0f, (float), __y0f_finite); |
| 186 | # ifdef __MATH_DECLARE_LDOUBLE |
| 187 | # ifdef __NO_LONG_DOUBLE_MATH |
| 188 | extern long double __REDIRECT_NTH (y0l, (long double), __y0_finite); |
| 189 | # else |
| 190 | extern long double __REDIRECT_NTH (y0l, (long double), __y0l_finite); |
| 191 | # endif |
| 192 | # endif |
| 193 | |
| 194 | /* j1. */ |
| 195 | extern double __REDIRECT_NTH (j1, (double), __j1_finite); |
| 196 | extern float __REDIRECT_NTH (j1f, (float), __j1f_finite); |
| 197 | # ifdef __MATH_DECLARE_LDOUBLE |
| 198 | # ifdef __NO_LONG_DOUBLE_MATH |
| 199 | extern long double __REDIRECT_NTH (j1l, (long double), __j1_finite); |
| 200 | # else |
| 201 | extern long double __REDIRECT_NTH (j1l, (long double), __j1l_finite); |
| 202 | # endif |
| 203 | # endif |
| 204 | |
| 205 | /* y1. */ |
| 206 | extern double __REDIRECT_NTH (y1, (double), __y1_finite); |
| 207 | extern float __REDIRECT_NTH (y1f, (float), __y1f_finite); |
| 208 | # ifdef __MATH_DECLARE_LDOUBLE |
| 209 | # ifdef __NO_LONG_DOUBLE_MATH |
| 210 | extern long double __REDIRECT_NTH (y1l, (long double), __y1_finite); |
| 211 | # else |
| 212 | extern long double __REDIRECT_NTH (y1l, (long double), __y1l_finite); |
| 213 | # endif |
| 214 | # endif |
| 215 | |
| 216 | /* jn. */ |
| 217 | extern double __REDIRECT_NTH (jn, (int, double), __jn_finite); |
| 218 | extern float __REDIRECT_NTH (jnf, (int, float), __jnf_finite); |
| 219 | # ifdef __MATH_DECLARE_LDOUBLE |
| 220 | # ifdef __NO_LONG_DOUBLE_MATH |
| 221 | extern long double __REDIRECT_NTH (jnl, (int, long double), __jn_finite); |
| 222 | # else |
| 223 | extern long double __REDIRECT_NTH (jnl, (int, long double), __jnl_finite); |
| 224 | # endif |
| 225 | # endif |
| 226 | |
| 227 | /* yn. */ |
| 228 | extern double __REDIRECT_NTH (yn, (int, double), __yn_finite); |
| 229 | extern float __REDIRECT_NTH (ynf, (int, float), __ynf_finite); |
| 230 | # ifdef __MATH_DECLARE_LDOUBLE |
| 231 | # ifdef __NO_LONG_DOUBLE_MATH |
| 232 | extern long double __REDIRECT_NTH (ynl, (int, long double), __yn_finite); |
| 233 | # else |
| 234 | extern long double __REDIRECT_NTH (ynl, (int, long double), __ynl_finite); |
| 235 | # endif |
| 236 | # endif |
| 237 | #endif |
| 238 | |
| 239 | #ifdef __USE_MISC |
| 240 | /* lgamma_r. */ |
| 241 | extern double __REDIRECT_NTH (lgamma_r, (double, int *), __lgamma_r_finite); |
| 242 | extern float __REDIRECT_NTH (lgammaf_r, (float, int *), __lgammaf_r_finite); |
| 243 | # ifdef __MATH_DECLARE_LDOUBLE |
| 244 | # ifdef __NO_LONG_DOUBLE_MATH |
| 245 | extern long double __REDIRECT_NTH (lgammal_r, (long double, int *), |
| 246 | __lgamma_r_finite); |
| 247 | # else |
| 248 | extern long double __REDIRECT_NTH (lgammal_r, (long double, int *), |
| 249 | __lgammal_r_finite); |
| 250 | # endif |
| 251 | # endif |
| 252 | #endif |
| 253 | |
| 254 | #if ((defined __USE_XOPEN || defined __USE_ISOC99) \ |
| 255 | && defined __extern_always_inline) |
| 256 | /* lgamma. */ |
| 257 | __extern_always_inline double __NTH (lgamma (double __d)) |
| 258 | { |
| 259 | # ifdef __USE_ISOC99 |
| 260 | int __local_signgam = 0; |
| 261 | return lgamma_r (__d, &__local_signgam); |
| 262 | # else |
| 263 | return lgamma_r (__d, &signgam); |
| 264 | # endif |
| 265 | } |
| 266 | __extern_always_inline float __NTH (lgammaf (float __d)) |
| 267 | { |
| 268 | # ifdef __USE_ISOC99 |
| 269 | int __local_signgam = 0; |
| 270 | return lgammaf_r (__d, &__local_signgam); |
| 271 | # else |
| 272 | return lgammaf_r (__d, &signgam); |
| 273 | # endif |
| 274 | } |
| 275 | # ifdef __MATH_DECLARE_LDOUBLE |
| 276 | __extern_always_inline long double __NTH (lgammal (long double __d)) |
| 277 | { |
| 278 | # ifdef __USE_ISOC99 |
| 279 | int __local_signgam = 0; |
| 280 | return lgammal_r (__d, &__local_signgam); |
| 281 | # else |
| 282 | return lgammal_r (__d, &signgam); |
| 283 | # endif |
| 284 | } |
| 285 | # endif |
| 286 | #endif |
| 287 | |
| 288 | #if ((defined __USE_MISC || defined __USE_XOPEN) \ |
| 289 | && defined __extern_always_inline) |
| 290 | /* gamma. */ |
| 291 | __extern_always_inline double __NTH (gamma (double __d)) |
| 292 | { |
| 293 | # ifdef __USE_ISOC99 |
| 294 | int __local_signgam = 0; |
| 295 | return lgamma_r (__d, &__local_signgam); |
| 296 | # else |
| 297 | return lgamma_r (__d, &signgam); |
| 298 | # endif |
| 299 | } |
| 300 | __extern_always_inline float __NTH (gammaf (float __d)) |
| 301 | { |
| 302 | # ifdef __USE_ISOC99 |
| 303 | int __local_signgam = 0; |
| 304 | return lgammaf_r (__d, &__local_signgam); |
| 305 | # else |
| 306 | return lgammaf_r (__d, &signgam); |
| 307 | # endif |
| 308 | } |
| 309 | # ifdef __MATH_DECLARE_LDOUBLE |
| 310 | __extern_always_inline long double __NTH (gammal (long double __d)) |
| 311 | { |
| 312 | # ifdef __USE_ISOC99 |
| 313 | int __local_signgam = 0; |
| 314 | return lgammal_r (__d, &__local_signgam); |
| 315 | # else |
| 316 | return lgammal_r (__d, &signgam); |
| 317 | # endif |
| 318 | } |
| 319 | # endif |
| 320 | #endif |
| 321 | |
| 322 | /* log. */ |
| 323 | extern double __REDIRECT_NTH (log, (double), __log_finite); |
| 324 | extern float __REDIRECT_NTH (logf, (float), __logf_finite); |
| 325 | #ifdef __MATH_DECLARE_LDOUBLE |
| 326 | # ifdef __NO_LONG_DOUBLE_MATH |
| 327 | extern long double __REDIRECT_NTH (logl, (long double), __log_finite); |
| 328 | # else |
| 329 | extern long double __REDIRECT_NTH (logl, (long double), __logl_finite); |
| 330 | # endif |
| 331 | #endif |
| 332 | |
| 333 | /* log10. */ |
| 334 | extern double __REDIRECT_NTH (log10, (double), __log10_finite); |
| 335 | extern float __REDIRECT_NTH (log10f, (float), __log10f_finite); |
| 336 | #ifdef __MATH_DECLARE_LDOUBLE |
| 337 | # ifdef __NO_LONG_DOUBLE_MATH |
| 338 | extern long double __REDIRECT_NTH (log10l, (long double), __log10_finite); |
| 339 | # else |
| 340 | extern long double __REDIRECT_NTH (log10l, (long double), __log10l_finite); |
| 341 | # endif |
| 342 | #endif |
| 343 | |
| 344 | #ifdef __USE_ISOC99 |
| 345 | /* log2. */ |
| 346 | extern double __REDIRECT_NTH (log2, (double), __log2_finite); |
| 347 | extern float __REDIRECT_NTH (log2f, (float), __log2f_finite); |
| 348 | # ifdef __MATH_DECLARE_LDOUBLE |
| 349 | # ifdef __NO_LONG_DOUBLE_MATH |
| 350 | extern long double __REDIRECT_NTH (log2l, (long double), __log2_finite); |
| 351 | # else |
| 352 | extern long double __REDIRECT_NTH (log2l, (long double), __log2l_finite); |
| 353 | # endif |
| 354 | # endif |
| 355 | #endif |
| 356 | |
| 357 | /* ldexp. */ |
| 358 | extern double __REDIRECT_NTH (ldexp, (double, int), scalbn); |
| 359 | extern float __REDIRECT_NTH (ldexpf, (float, int), scalbnf); |
| 360 | #ifdef __MATH_DECLARE_LDOUBLE |
| 361 | extern long double __REDIRECT_NTH (ldexpl, (long double, int), scalbnl); |
| 362 | #endif |
| 363 | |
| 364 | /* pow. */ |
| 365 | extern double __REDIRECT_NTH (pow, (double, double), __pow_finite); |
| 366 | extern float __REDIRECT_NTH (powf, (float, float), __powf_finite); |
| 367 | #ifdef __MATH_DECLARE_LDOUBLE |
| 368 | # ifdef __NO_LONG_DOUBLE_MATH |
| 369 | extern long double __REDIRECT_NTH (powl, (long double, long double), |
| 370 | __pow_finite); |
| 371 | # else |
| 372 | extern long double __REDIRECT_NTH (powl, (long double, long double), |
| 373 | __powl_finite); |
| 374 | # endif |
| 375 | #endif |
| 376 | |
| 377 | /* remainder. */ |
| 378 | extern double __REDIRECT_NTH (remainder, (double, double), __remainder_finite); |
| 379 | extern float __REDIRECT_NTH (remainderf, (float, float), __remainderf_finite); |
| 380 | #ifdef __MATH_DECLARE_LDOUBLE |
| 381 | # ifdef __NO_LONG_DOUBLE_MATH |
| 382 | extern long double __REDIRECT_NTH (remainderl, (long double, long double), |
| 383 | __remainder_finite); |
| 384 | # else |
| 385 | extern long double __REDIRECT_NTH (remainderl, (long double, long double), |
| 386 | __remainderl_finite); |
| 387 | # endif |
| 388 | #endif |
| 389 | |
| 390 | #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED |
| 391 | /* scalb. */ |
| 392 | extern double __REDIRECT_NTH (scalb, (double, double), __scalb_finite); |
| 393 | extern float __REDIRECT_NTH (scalbf, (float, float), __scalbf_finite); |
| 394 | # ifdef __MATH_DECLARE_LDOUBLE |
| 395 | # ifdef __NO_LONG_DOUBLE_MATH |
| 396 | extern long double __REDIRECT_NTH (scalbl, (long double, long double), |
| 397 | __scalb_finite); |
| 398 | # else |
| 399 | extern long double __REDIRECT_NTH (scalbl, (long double, long double), |
| 400 | __scalbl_finite); |
| 401 | # endif |
| 402 | # endif |
| 403 | #endif |
| 404 | |
| 405 | /* sinh. */ |
| 406 | extern double __REDIRECT_NTH (sinh, (double), __sinh_finite); |
| 407 | extern float __REDIRECT_NTH (sinhf, (float), __sinhf_finite); |
| 408 | #ifdef __MATH_DECLARE_LDOUBLE |
| 409 | # ifdef __NO_LONG_DOUBLE_MATH |
| 410 | extern long double __REDIRECT_NTH (sinhl, (long double), __sinh_finite); |
| 411 | # else |
| 412 | extern long double __REDIRECT_NTH (sinhl, (long double), __sinhl_finite); |
| 413 | # endif |
| 414 | #endif |
| 415 | |
| 416 | /* sqrt. */ |
| 417 | extern double __REDIRECT_NTH (sqrt, (double), __sqrt_finite); |
| 418 | extern float __REDIRECT_NTH (sqrtf, (float), __sqrtf_finite); |
| 419 | #ifdef __MATH_DECLARE_LDOUBLE |
| 420 | # ifdef __NO_LONG_DOUBLE_MATH |
| 421 | extern long double __REDIRECT_NTH (sqrtl, (long double), __sqrt_finite); |
| 422 | # else |
| 423 | extern long double __REDIRECT_NTH (sqrtl, (long double), __sqrtl_finite); |
| 424 | # endif |
| 425 | #endif |
| 426 | |
| 427 | #if defined __USE_ISOC99 && defined __extern_always_inline |
| 428 | /* tgamma. */ |
| 429 | extern double __gamma_r_finite (double, int *); |
| 430 | __extern_always_inline double __NTH (tgamma (double __d)) |
| 431 | { |
| 432 | int __local_signgam = 0; |
| 433 | double __res = __gamma_r_finite (__d, &__local_signgam); |
| 434 | return __local_signgam < 0 ? -__res : __res; |
| 435 | } |
| 436 | extern float __gammaf_r_finite (float, int *); |
| 437 | __extern_always_inline float __NTH (tgammaf (float __d)) |
| 438 | { |
| 439 | int __local_signgam = 0; |
| 440 | float __res = __gammaf_r_finite (__d, &__local_signgam); |
| 441 | return __local_signgam < 0 ? -__res : __res; |
| 442 | } |
| 443 | # ifdef __MATH_DECLARE_LDOUBLE |
| 444 | extern long double __gammal_r_finite (long double, int *); |
| 445 | __extern_always_inline long double __NTH (tgammal (long double __d)) |
| 446 | { |
| 447 | int __local_signgam = 0; |
| 448 | # ifdef __NO_LONG_DOUBLE_MATH |
| 449 | long double __res = __gamma_r_finite (__d, &__local_signgam); |
| 450 | # else |
| 451 | long double __res = __gammal_r_finite (__d, &__local_signgam); |
| 452 | # endif |
| 453 | return __local_signgam < 0 ? -__res : __res; |
| 454 | } |
| 455 | # endif |
| 456 | #endif |