Replace FSF snail mail address with URLs.
[glibc.git] / math / bits / math-finite.h
blobac1b345536dab396a341120d3d5b10f73ceecd33
1 /* Entry points to finite-math-only compiler runs.
2 Copyright (C) 2011, 2012 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
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.
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.
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/>. */
19 #ifndef _MATH_H
20 # error "Never use <bits/math-finite.h> directly; include <math.h> instead."
21 #endif
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 extern long double __REDIRECT_NTH (acosl, (long double), __acosl_finite);
28 #endif
30 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
31 /* acosh. */
32 extern double __REDIRECT_NTH (acosh, (double), __acosh_finite);
33 extern float __REDIRECT_NTH (acoshf, (float), __acoshf_finite);
34 # ifdef __MATH_DECLARE_LDOUBLE
35 extern long double __REDIRECT_NTH (acoshl, (long double), __acoshl_finite);
36 # endif
37 #endif
39 /* asin. */
40 extern double __REDIRECT_NTH (asin, (double), __asin_finite);
41 extern float __REDIRECT_NTH (asinf, (float), __asinf_finite);
42 #ifdef __MATH_DECLARE_LDOUBLE
43 extern long double __REDIRECT_NTH (asinl, (long double), __asinl_finite);
44 #endif
46 /* atan2. */
47 extern double __REDIRECT_NTH (atan2, (double, double), __atan2_finite);
48 extern float __REDIRECT_NTH (atan2f, (float, float), __atan2f_finite);
49 #ifdef __MATH_DECLARE_LDOUBLE
50 extern long double __REDIRECT_NTH (atan2l, (long double, long double),
51 __atan2l_finite);
52 #endif
54 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_ISOC99
55 /* atanh. */
56 extern double __REDIRECT_NTH (atanh, (double), __atanh_finite);
57 extern float __REDIRECT_NTH (atanhf, (float), __atanhf_finite);
58 # ifdef __MATH_DECLARE_LDOUBLE
59 extern long double __REDIRECT_NTH (atanhl, (long double), __atanhl_finite);
60 # endif
61 #endif
63 /* cosh. */
64 extern double __REDIRECT_NTH (cosh, (double), __cosh_finite);
65 extern float __REDIRECT_NTH (coshf, (float), __coshf_finite);
66 #ifdef __MATH_DECLARE_LDOUBLE
67 extern long double __REDIRECT_NTH (coshl, (long double), __coshl_finite);
68 #endif
70 /* exp. */
71 extern double __REDIRECT_NTH (exp, (double), __exp_finite);
72 extern float __REDIRECT_NTH (expf, (float), __expf_finite);
73 #ifdef __MATH_DECLARE_LDOUBLE
74 extern long double __REDIRECT_NTH (expl, (long double), __expl_finite);
75 #endif
77 #ifdef __USE_GNU
78 /* exp10. */
79 extern double __REDIRECT_NTH (exp10, (double), __exp10_finite);
80 extern float __REDIRECT_NTH (exp10f, (float), __exp10f_finite);
81 # ifdef __MATH_DECLARE_LDOUBLE
82 extern long double __REDIRECT_NTH (exp10l, (long double), __exp10l_finite);
83 # endif
85 /* pow10. */
86 extern double __REDIRECT_NTH (pow10, (double), __exp10_finite);
87 extern float __REDIRECT_NTH (pow10f, (float), __exp10f_finite);
88 # ifdef __MATH_DECLARE_LDOUBLE
89 extern long double __REDIRECT_NTH (pow10l, (long double), __exp10l_finite);
90 # endif
91 #endif
93 #ifdef __USE_ISOC99
94 /* exp2. */
95 extern double __REDIRECT_NTH (exp2, (double), __exp2_finite);
96 extern float __REDIRECT_NTH (exp2f, (float), __exp2f_finite);
97 # ifdef __MATH_DECLARE_LDOUBLE
98 extern long double __REDIRECT_NTH (exp2l, (long double), __exp2l_finite);
99 # endif
100 #endif
102 /* fmod. */
103 extern double __REDIRECT_NTH (fmod, (double, double), __fmod_finite);
104 extern float __REDIRECT_NTH (fmodf, (float, float), __fmodf_finite);
105 #ifdef __MATH_DECLARE_LDOUBLE
106 extern long double __REDIRECT_NTH (fmodl, (long double, long double),
107 __fmodl_finite);
108 #endif
110 #ifdef __USE_ISOC99
111 /* hypot. */
112 extern double __REDIRECT_NTH (hypot, (double, double), __hypot_finite);
113 extern float __REDIRECT_NTH (hypotf, (float, float), __hypotf_finite);
114 # ifdef __MATH_DECLARE_LDOUBLE
115 extern long double __REDIRECT_NTH (hypotl, (long double, long double),
116 __hypotl_finite);
117 # endif
118 #endif
120 #if defined __USE_MISC || defined __USE_XOPEN
121 /* j0. */
122 extern double __REDIRECT_NTH (j0, (double), __j0_finite);
123 extern float __REDIRECT_NTH (j0f, (float), __j0f_finite);
124 # ifdef __MATH_DECLARE_LDOUBLE
125 extern long double __REDIRECT_NTH (j0l, (long double), __j0l_finite);
126 # endif
128 /* y0. */
129 extern double __REDIRECT_NTH (y0, (double), __y0_finite);
130 extern float __REDIRECT_NTH (y0f, (float), __y0f_finite);
131 # ifdef __MATH_DECLARE_LDOUBLE
132 extern long double __REDIRECT_NTH (y0l, (long double), __y0l_finite);
133 # endif
135 /* j1. */
136 extern double __REDIRECT_NTH (j1, (double), __j1_finite);
137 extern float __REDIRECT_NTH (j1f, (float), __j1f_finite);
138 # ifdef __MATH_DECLARE_LDOUBLE
139 extern long double __REDIRECT_NTH (j1l, (long double), __j1l_finite);
140 # endif
142 /* y1. */
143 extern double __REDIRECT_NTH (y1, (double), __y1_finite);
144 extern float __REDIRECT_NTH (y1f, (float), __y1f_finite);
145 # ifdef __MATH_DECLARE_LDOUBLE
146 extern long double __REDIRECT_NTH (y1l, (long double), __y1l_finite);
147 # endif
149 /* jn. */
150 extern double __REDIRECT_NTH (jn, (int, double), __jn_finite);
151 extern float __REDIRECT_NTH (jnf, (int, float), __jnf_finite);
152 # ifdef __MATH_DECLARE_LDOUBLE
153 extern long double __REDIRECT_NTH (jnl, (int, long double), __jnl_finite);
154 # endif
156 /* yn. */
157 extern double __REDIRECT_NTH (yn, (int, double), __yn_finite);
158 extern float __REDIRECT_NTH (ynf, (int, float), __ynf_finite);
159 # ifdef __MATH_DECLARE_LDOUBLE
160 extern long double __REDIRECT_NTH (ynl, (int, long double), __ynl_finite);
161 # endif
162 #endif
164 #ifdef __USE_MISC
165 /* lgamma_r. */
166 extern double __REDIRECT_NTH (lgamma_r, (double, int *), __lgamma_r_finite);
167 extern float __REDIRECT_NTH (lgammaf_r, (float, int *), __lgammaf_r_finite);
168 # ifdef __MATH_DECLARE_LDOUBLE
169 extern long double __REDIRECT_NTH (lgammal_r, (long double, int *),
170 __lgammal_r_finite);
171 # endif
172 #endif
174 #if defined __USE_MISC || defined __USE_XOPEN || defined __USE_ISOC99
175 /* lgamma. */
176 __extern_always_inline double __NTH (lgamma (double __d))
178 # ifdef __USE_ISOC99
179 int __local_signgam = 0;
180 return lgamma_r (__d, &__local_signgam);
181 # else
182 return lgamma_r (__d, &signgam);
183 # endif
185 __extern_always_inline float __NTH (lgammaf (float __d))
187 # ifdef __USE_ISOC99
188 int __local_signgam = 0;
189 return lgammaf_r (__d, &__local_signgam);
190 # else
191 return lgammaf_r (__d, &signgam);
192 # endif
194 # ifdef __MATH_DECLARE_LDOUBLE
195 __extern_always_inline long double __NTH (lgammal (long double __d))
197 # ifdef __USE_ISOC99
198 int __local_signgam = 0;
199 return lgammal_r (__d, &__local_signgam);
200 # else
201 return lgammal_r (__d, &signgam);
202 # endif
204 # endif
205 #endif
207 #if defined __USE_MISC || defined __USE_XOPEN
208 /* gamma. */
209 __extern_always_inline double __NTH (gamma (double __d))
211 # ifdef __USE_ISOC99
212 int __local_signgam = 0;
213 return lgamma_r (__d, &__local_signgam);
214 # else
215 return lgamma_r (__d, &signgam);
216 # endif
218 __extern_always_inline float __NTH (gammaf (float __d))
220 # ifdef __USE_ISOC99
221 int __local_signgam = 0;
222 return lgammaf_r (__d, &__local_signgam);
223 # else
224 return lgammaf_r (__d, &signgam);
225 # endif
227 # ifdef __MATH_DECLARE_LDOUBLE
228 __extern_always_inline long double __NTH (gammal (long double __d))
230 # ifdef __USE_ISOC99
231 int __local_signgam = 0;
232 return lgammal_r (__d, &__local_signgam);
233 # else
234 return lgammal_r (__d, &signgam);
235 # endif
237 # endif
238 #endif
240 /* log. */
241 extern double __REDIRECT_NTH (log, (double), __log_finite);
242 extern float __REDIRECT_NTH (logf, (float), __logf_finite);
243 #ifdef __MATH_DECLARE_LDOUBLE
244 extern long double __REDIRECT_NTH (logl, (long double), __logl_finite);
245 #endif
247 /* log10. */
248 extern double __REDIRECT_NTH (log10, (double), __log10_finite);
249 extern float __REDIRECT_NTH (log10f, (float), __log10f_finite);
250 #ifdef __MATH_DECLARE_LDOUBLE
251 extern long double __REDIRECT_NTH (log10l, (long double), __log10l_finite);
252 #endif
254 #ifdef __USE_ISOC99
255 /* log2. */
256 extern double __REDIRECT_NTH (log2, (double), __log2_finite);
257 extern float __REDIRECT_NTH (log2f, (float), __log2f_finite);
258 # ifdef __MATH_DECLARE_LDOUBLE
259 extern long double __REDIRECT_NTH (log2l, (long double), __log2l_finite);
260 # endif
261 #endif
263 /* ldexp. */
264 extern double __REDIRECT_NTH (ldexp, (double, int), scalbn);
265 extern float __REDIRECT_NTH (ldexpf, (float, int), scalbnf);
266 #ifdef __MATH_DECLARE_LDOUBLE
267 extern long double __REDIRECT_NTH (ldexpl, (long double, int), scalbnl);
268 #endif
270 /* pow. */
271 extern double __REDIRECT_NTH (pow, (double, double), __pow_finite);
272 extern float __REDIRECT_NTH (powf, (float, float), __powf_finite);
273 #ifdef __MATH_DECLARE_LDOUBLE
274 extern long double __REDIRECT_NTH (powl, (long double, long double),
275 __powl_finite);
276 #endif
278 /* remainder. */
279 extern double __REDIRECT_NTH (remainder, (double, double), __remainder_finite);
280 extern float __REDIRECT_NTH (remainderf, (float, float), __remainderf_finite);
281 #ifdef __MATH_DECLARE_LDOUBLE
282 extern long double __REDIRECT_NTH (remainderl, (long double, long double),
283 __remainderl_finite);
284 #endif
286 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
287 /* scalb. */
288 extern double __REDIRECT_NTH (scalb, (double, double), __scalb_finite);
289 extern float __REDIRECT_NTH (scalbf, (float, float), __scalbf_finite);
290 # ifdef __MATH_DECLARE_LDOUBLE
291 extern long double __REDIRECT_NTH (scalbl, (long double, long double),
292 __scalbl_finite);
293 # endif
294 #endif
296 /* sinh. */
297 extern double __REDIRECT_NTH (sinh, (double), __sinh_finite);
298 extern float __REDIRECT_NTH (sinhf, (float), __sinhf_finite);
299 #ifdef __MATH_DECLARE_LDOUBLE
300 extern long double __REDIRECT_NTH (sinhl, (long double), __sinhl_finite);
301 #endif
303 /* sqrt. */
304 extern double __REDIRECT_NTH (sqrt, (double), __sqrt_finite);
305 extern float __REDIRECT_NTH (sqrtf, (float), __sqrtf_finite);
306 #ifdef __MATH_DECLARE_LDOUBLE
307 extern long double __REDIRECT_NTH (sqrtl, (long double), __sqrtl_finite);
308 #endif
310 #ifdef __USE_ISOC99
311 /* tgamma. */
312 extern double __gamma_r_finite (double, int *);
313 __extern_always_inline double __NTH (tgamma (double __d))
315 int __local_signgam = 0;
316 double __res = __gamma_r_finite (__d, &__local_signgam);
317 return __local_signgam < 0 ? -__res : __res;
319 extern float __gammaf_r_finite (float, int *);
320 __extern_always_inline float __NTH (tgammaf (float __d))
322 int __local_signgam = 0;
323 float __res = __gammaf_r_finite (__d, &__local_signgam);
324 return __local_signgam < 0 ? -__res : __res;
326 # ifdef __MATH_DECLARE_LDOUBLE
327 extern long double __gammal_r_finite (long double, int *);
328 __extern_always_inline long double __NTH (tgammal (long double __d))
330 int __local_signgam = 0;
331 long double __res = __gammal_r_finite (__d, &__local_signgam);
332 return __local_signgam < 0 ? -__res : __res;
334 # endif
335 #endif