libstdc++
cmath
1 // -*- C++ -*- C forwarding header.
2 
3 // Copyright (C) 1997-2014 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
9 // any later version.
10 
11 // This library 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 General Public License for more details.
15 
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
19 
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
24 
25 /** @file include/cmath
26  * This is a Standard C++ Library file. You should @c \#include this file
27  * in your programs, rather than any of the @a *.h implementation files.
28  *
29  * This is the C++ version of the Standard C Library header @c math.h,
30  * and its contents are (mostly) the same as that header, but are all
31  * contained in the namespace @c std (except for names which are defined
32  * as macros in C).
33  */
34 
35 //
36 // ISO C++ 14882: 26.5 C library
37 //
38 
39 #pragma GCC system_header
40 
41 #include <bits/c++config.h>
42 #include <bits/cpp_type_traits.h>
43 #include <ext/type_traits.h>
44 #include <math.h>
45 
46 #ifndef _GLIBCXX_CMATH
47 #define _GLIBCXX_CMATH 1
48 
49 // Get rid of those macros defined in <math.h> in lieu of real functions.
50 #undef abs
51 #undef div
52 #undef acos
53 #undef asin
54 #undef atan
55 #undef atan2
56 #undef ceil
57 #undef cos
58 #undef cosh
59 #undef exp
60 #undef fabs
61 #undef floor
62 #undef fmod
63 #undef frexp
64 #undef ldexp
65 #undef log
66 #undef log10
67 #undef modf
68 #undef pow
69 #undef sin
70 #undef sinh
71 #undef sqrt
72 #undef tan
73 #undef tanh
74 
75 namespace std _GLIBCXX_VISIBILITY(default)
76 {
77 _GLIBCXX_BEGIN_NAMESPACE_VERSION
78 
79 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
80  inline _GLIBCXX_CONSTEXPR double
81  abs(double __x)
82  { return __builtin_fabs(__x); }
83 #endif
84 
85 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
86  inline _GLIBCXX_CONSTEXPR float
87  abs(float __x)
88  { return __builtin_fabsf(__x); }
89 
90  inline _GLIBCXX_CONSTEXPR long double
91  abs(long double __x)
92  { return __builtin_fabsl(__x); }
93 #endif
94 
95  template<typename _Tp>
96  inline _GLIBCXX_CONSTEXPR
97  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
98  double>::__type
99  abs(_Tp __x)
100  { return __builtin_fabs(__x); }
101 
102  using ::acos;
103 
104 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
105  inline _GLIBCXX_CONSTEXPR float
106  acos(float __x)
107  { return __builtin_acosf(__x); }
108 
109  inline _GLIBCXX_CONSTEXPR long double
110  acos(long double __x)
111  { return __builtin_acosl(__x); }
112 #endif
113 
114  template<typename _Tp>
115  inline _GLIBCXX_CONSTEXPR
116  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
117  double>::__type
118  acos(_Tp __x)
119  { return __builtin_acos(__x); }
120 
121  using ::asin;
122 
123 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
124  inline _GLIBCXX_CONSTEXPR float
125  asin(float __x)
126  { return __builtin_asinf(__x); }
127 
128  inline _GLIBCXX_CONSTEXPR long double
129  asin(long double __x)
130  { return __builtin_asinl(__x); }
131 #endif
132 
133  template<typename _Tp>
134  inline _GLIBCXX_CONSTEXPR
135  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
136  double>::__type
137  asin(_Tp __x)
138  { return __builtin_asin(__x); }
139 
140  using ::atan;
141 
142 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
143  inline _GLIBCXX_CONSTEXPR float
144  atan(float __x)
145  { return __builtin_atanf(__x); }
146 
147  inline _GLIBCXX_CONSTEXPR long double
148  atan(long double __x)
149  { return __builtin_atanl(__x); }
150 #endif
151 
152  template<typename _Tp>
153  inline _GLIBCXX_CONSTEXPR
154  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
155  double>::__type
156  atan(_Tp __x)
157  { return __builtin_atan(__x); }
158 
159  using ::atan2;
160 
161 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
162  inline _GLIBCXX_CONSTEXPR float
163  atan2(float __y, float __x)
164  { return __builtin_atan2f(__y, __x); }
165 
166  inline _GLIBCXX_CONSTEXPR long double
167  atan2(long double __y, long double __x)
168  { return __builtin_atan2l(__y, __x); }
169 #endif
170 
171  template<typename _Tp, typename _Up>
172  inline _GLIBCXX_CONSTEXPR
173  typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
174  atan2(_Tp __y, _Up __x)
175  {
176  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
177  return atan2(__type(__y), __type(__x));
178  }
179 
180  using ::ceil;
181 
182 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
183  inline _GLIBCXX_CONSTEXPR float
184  ceil(float __x)
185  { return __builtin_ceilf(__x); }
186 
187  inline _GLIBCXX_CONSTEXPR long double
188  ceil(long double __x)
189  { return __builtin_ceill(__x); }
190 #endif
191 
192  template<typename _Tp>
193  inline _GLIBCXX_CONSTEXPR
194  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
195  double>::__type
196  ceil(_Tp __x)
197  { return __builtin_ceil(__x); }
198 
199  using ::cos;
200 
201 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
202  inline _GLIBCXX_CONSTEXPR float
203  cos(float __x)
204  { return __builtin_cosf(__x); }
205 
206  inline _GLIBCXX_CONSTEXPR long double
207  cos(long double __x)
208  { return __builtin_cosl(__x); }
209 #endif
210 
211  template<typename _Tp>
212  inline _GLIBCXX_CONSTEXPR
213  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
214  double>::__type
215  cos(_Tp __x)
216  { return __builtin_cos(__x); }
217 
218  using ::cosh;
219 
220 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
221  inline _GLIBCXX_CONSTEXPR float
222  cosh(float __x)
223  { return __builtin_coshf(__x); }
224 
225  inline _GLIBCXX_CONSTEXPR long double
226  cosh(long double __x)
227  { return __builtin_coshl(__x); }
228 #endif
229 
230  template<typename _Tp>
231  inline _GLIBCXX_CONSTEXPR
232  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
233  double>::__type
234  cosh(_Tp __x)
235  { return __builtin_cosh(__x); }
236 
237  using ::exp;
238 
239 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
240  inline _GLIBCXX_CONSTEXPR float
241  exp(float __x)
242  { return __builtin_expf(__x); }
243 
244  inline _GLIBCXX_CONSTEXPR long double
245  exp(long double __x)
246  { return __builtin_expl(__x); }
247 #endif
248 
249  template<typename _Tp>
250  inline _GLIBCXX_CONSTEXPR
251  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
252  double>::__type
253  exp(_Tp __x)
254  { return __builtin_exp(__x); }
255 
256  using ::fabs;
257 
258 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
259  inline _GLIBCXX_CONSTEXPR float
260  fabs(float __x)
261  { return __builtin_fabsf(__x); }
262 
263  inline _GLIBCXX_CONSTEXPR long double
264  fabs(long double __x)
265  { return __builtin_fabsl(__x); }
266 #endif
267 
268  template<typename _Tp>
269  inline _GLIBCXX_CONSTEXPR
270  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
271  double>::__type
272  fabs(_Tp __x)
273  { return __builtin_fabs(__x); }
274 
275  using ::floor;
276 
277 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
278  inline _GLIBCXX_CONSTEXPR float
279  floor(float __x)
280  { return __builtin_floorf(__x); }
281 
282  inline _GLIBCXX_CONSTEXPR long double
283  floor(long double __x)
284  { return __builtin_floorl(__x); }
285 #endif
286 
287  template<typename _Tp>
288  inline _GLIBCXX_CONSTEXPR
289  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
290  double>::__type
291  floor(_Tp __x)
292  { return __builtin_floor(__x); }
293 
294  using ::fmod;
295 
296 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
297  inline _GLIBCXX_CONSTEXPR float
298  fmod(float __x, float __y)
299  { return __builtin_fmodf(__x, __y); }
300 
301  inline _GLIBCXX_CONSTEXPR long double
302  fmod(long double __x, long double __y)
303  { return __builtin_fmodl(__x, __y); }
304 #endif
305 
306  template<typename _Tp, typename _Up>
307  inline _GLIBCXX_CONSTEXPR
308  typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
309  fmod(_Tp __x, _Up __y)
310  {
311  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
312  return fmod(__type(__x), __type(__y));
313  }
314 
315  using ::frexp;
316 
317 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
318  inline float
319  frexp(float __x, int* __exp)
320  { return __builtin_frexpf(__x, __exp); }
321 
322  inline long double
323  frexp(long double __x, int* __exp)
324  { return __builtin_frexpl(__x, __exp); }
325 #endif
326 
327  template<typename _Tp>
328  inline _GLIBCXX_CONSTEXPR
329  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
330  double>::__type
331  frexp(_Tp __x, int* __exp)
332  { return __builtin_frexp(__x, __exp); }
333 
334  using ::ldexp;
335 
336 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
337  inline _GLIBCXX_CONSTEXPR float
338  ldexp(float __x, int __exp)
339  { return __builtin_ldexpf(__x, __exp); }
340 
341  inline _GLIBCXX_CONSTEXPR long double
342  ldexp(long double __x, int __exp)
343  { return __builtin_ldexpl(__x, __exp); }
344 #endif
345 
346  template<typename _Tp>
347  inline _GLIBCXX_CONSTEXPR
348  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
349  double>::__type
350  ldexp(_Tp __x, int __exp)
351  { return __builtin_ldexp(__x, __exp); }
352 
353  using ::log;
354 
355 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
356  inline _GLIBCXX_CONSTEXPR float
357  log(float __x)
358  { return __builtin_logf(__x); }
359 
360  inline _GLIBCXX_CONSTEXPR long double
361  log(long double __x)
362  { return __builtin_logl(__x); }
363 #endif
364 
365  template<typename _Tp>
366  inline _GLIBCXX_CONSTEXPR
367  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
368  double>::__type
369  log(_Tp __x)
370  { return __builtin_log(__x); }
371 
372  using ::log10;
373 
374 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
375  inline _GLIBCXX_CONSTEXPR float
376  log10(float __x)
377  { return __builtin_log10f(__x); }
378 
379  inline _GLIBCXX_CONSTEXPR long double
380  log10(long double __x)
381  { return __builtin_log10l(__x); }
382 #endif
383 
384  template<typename _Tp>
385  inline _GLIBCXX_CONSTEXPR
386  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
387  double>::__type
388  log10(_Tp __x)
389  { return __builtin_log10(__x); }
390 
391  using ::modf;
392 
393 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
394  inline float
395  modf(float __x, float* __iptr)
396  { return __builtin_modff(__x, __iptr); }
397 
398  inline long double
399  modf(long double __x, long double* __iptr)
400  { return __builtin_modfl(__x, __iptr); }
401 #endif
402 
403  using ::pow;
404 
405 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
406  inline _GLIBCXX_CONSTEXPR float
407  pow(float __x, float __y)
408  { return __builtin_powf(__x, __y); }
409 
410  inline _GLIBCXX_CONSTEXPR long double
411  pow(long double __x, long double __y)
412  { return __builtin_powl(__x, __y); }
413 
414 #if __cplusplus < 201103L
415  // _GLIBCXX_RESOLVE_LIB_DEFECTS
416  // DR 550. What should the return type of pow(float,int) be?
417  inline double
418  pow(double __x, int __i)
419  { return __builtin_powi(__x, __i); }
420 
421  inline float
422  pow(float __x, int __n)
423  { return __builtin_powif(__x, __n); }
424 
425  inline long double
426  pow(long double __x, int __n)
427  { return __builtin_powil(__x, __n); }
428 #endif
429 #endif
430 
431  template<typename _Tp, typename _Up>
432  inline _GLIBCXX_CONSTEXPR
433  typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
434  pow(_Tp __x, _Up __y)
435  {
436  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
437  return pow(__type(__x), __type(__y));
438  }
439 
440  using ::sin;
441 
442 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
443  inline _GLIBCXX_CONSTEXPR float
444  sin(float __x)
445  { return __builtin_sinf(__x); }
446 
447  inline _GLIBCXX_CONSTEXPR long double
448  sin(long double __x)
449  { return __builtin_sinl(__x); }
450 #endif
451 
452  template<typename _Tp>
453  inline _GLIBCXX_CONSTEXPR
454  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
455  double>::__type
456  sin(_Tp __x)
457  { return __builtin_sin(__x); }
458 
459  using ::sinh;
460 
461 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
462  inline _GLIBCXX_CONSTEXPR float
463  sinh(float __x)
464  { return __builtin_sinhf(__x); }
465 
466  inline _GLIBCXX_CONSTEXPR long double
467  sinh(long double __x)
468  { return __builtin_sinhl(__x); }
469 #endif
470 
471  template<typename _Tp>
472  inline _GLIBCXX_CONSTEXPR
473  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
474  double>::__type
475  sinh(_Tp __x)
476  { return __builtin_sinh(__x); }
477 
478  using ::sqrt;
479 
480 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
481  inline _GLIBCXX_CONSTEXPR float
482  sqrt(float __x)
483  { return __builtin_sqrtf(__x); }
484 
485  inline _GLIBCXX_CONSTEXPR long double
486  sqrt(long double __x)
487  { return __builtin_sqrtl(__x); }
488 #endif
489 
490  template<typename _Tp>
491  inline _GLIBCXX_CONSTEXPR
492  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
493  double>::__type
494  sqrt(_Tp __x)
495  { return __builtin_sqrt(__x); }
496 
497  using ::tan;
498 
499 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
500  inline _GLIBCXX_CONSTEXPR float
501  tan(float __x)
502  { return __builtin_tanf(__x); }
503 
504  inline _GLIBCXX_CONSTEXPR long double
505  tan(long double __x)
506  { return __builtin_tanl(__x); }
507 #endif
508 
509  template<typename _Tp>
510  inline _GLIBCXX_CONSTEXPR
511  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
512  double>::__type
513  tan(_Tp __x)
514  { return __builtin_tan(__x); }
515 
516  using ::tanh;
517 
518 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
519  inline _GLIBCXX_CONSTEXPR float
520  tanh(float __x)
521  { return __builtin_tanhf(__x); }
522 
523  inline _GLIBCXX_CONSTEXPR long double
524  tanh(long double __x)
525  { return __builtin_tanhl(__x); }
526 #endif
527 
528  template<typename _Tp>
529  inline _GLIBCXX_CONSTEXPR
530  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
531  double>::__type
532  tanh(_Tp __x)
533  { return __builtin_tanh(__x); }
534 
535 _GLIBCXX_END_NAMESPACE_VERSION
536 } // namespace
537 
538 #if _GLIBCXX_USE_C99_MATH
539 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
540 
541 // These are possible macros imported from C99-land.
542 #undef fpclassify
543 #undef isfinite
544 #undef isinf
545 #undef isnan
546 #undef isnormal
547 #undef signbit
548 #undef isgreater
549 #undef isgreaterequal
550 #undef isless
551 #undef islessequal
552 #undef islessgreater
553 #undef isunordered
554 
555 namespace std _GLIBCXX_VISIBILITY(default)
556 {
557 _GLIBCXX_BEGIN_NAMESPACE_VERSION
558 
559 #if __cplusplus >= 201103L
560  constexpr int
561  fpclassify(float __x)
562  { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
563  FP_SUBNORMAL, FP_ZERO, __x); }
564 
565  constexpr int
566  fpclassify(double __x)
567  { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
568  FP_SUBNORMAL, FP_ZERO, __x); }
569 
570  constexpr int
571  fpclassify(long double __x)
572  { return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
573  FP_SUBNORMAL, FP_ZERO, __x); }
574 
575  template<typename _Tp>
576  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
577  int>::__type
578  fpclassify(_Tp __x)
579  { return __x != 0 ? FP_NORMAL : FP_ZERO; }
580 
581  constexpr bool
582  isfinite(float __x)
583  { return __builtin_isfinite(__x); }
584 
585  constexpr bool
586  isfinite(double __x)
587  { return __builtin_isfinite(__x); }
588 
589  constexpr bool
590  isfinite(long double __x)
591  { return __builtin_isfinite(__x); }
592 
593  template<typename _Tp>
594  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
595  bool>::__type
596  isfinite(_Tp __x)
597  { return true; }
598 
599  constexpr bool
600  isinf(float __x)
601  { return __builtin_isinf(__x); }
602 
603  constexpr bool
604  isinf(double __x)
605  { return __builtin_isinf(__x); }
606 
607  constexpr bool
608  isinf(long double __x)
609  { return __builtin_isinf(__x); }
610 
611  template<typename _Tp>
612  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
613  bool>::__type
614  isinf(_Tp __x)
615  { return false; }
616 
617  constexpr bool
618  isnan(float __x)
619  { return __builtin_isnan(__x); }
620 
621  constexpr bool
622  isnan(double __x)
623  { return __builtin_isnan(__x); }
624 
625  constexpr bool
626  isnan(long double __x)
627  { return __builtin_isnan(__x); }
628 
629  template<typename _Tp>
630  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
631  bool>::__type
632  isnan(_Tp __x)
633  { return false; }
634 
635  constexpr bool
636  isnormal(float __x)
637  { return __builtin_isnormal(__x); }
638 
639  constexpr bool
640  isnormal(double __x)
641  { return __builtin_isnormal(__x); }
642 
643  constexpr bool
644  isnormal(long double __x)
645  { return __builtin_isnormal(__x); }
646 
647  template<typename _Tp>
648  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
649  bool>::__type
650  isnormal(_Tp __x)
651  { return __x != 0 ? true : false; }
652 
653  // The front-end doesn't provide a type generic builtin (libstdc++/58625).
654  constexpr bool
655  signbit(float __x)
656  { return __builtin_signbitf(__x); }
657 
658  constexpr bool
659  signbit(double __x)
660  { return __builtin_signbit(__x); }
661 
662  constexpr bool
663  signbit(long double __x)
664  { return __builtin_signbitl(__x); }
665 
666  template<typename _Tp>
667  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
668  bool>::__type
669  signbit(_Tp __x)
670  { return __x < 0 ? true : false; }
671 
672  constexpr bool
673  isgreater(float __x, float __y)
674  { return __builtin_isgreater(__x, __y); }
675 
676  constexpr bool
677  isgreater(double __x, double __y)
678  { return __builtin_isgreater(__x, __y); }
679 
680  constexpr bool
681  isgreater(long double __x, long double __y)
682  { return __builtin_isgreater(__x, __y); }
683 
684  template<typename _Tp, typename _Up>
685  constexpr typename
686  __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
687  && __is_arithmetic<_Up>::__value), bool>::__type
688  isgreater(_Tp __x, _Up __y)
689  {
690  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
691  return __builtin_isgreater(__type(__x), __type(__y));
692  }
693 
694  constexpr bool
695  isgreaterequal(float __x, float __y)
696  { return __builtin_isgreaterequal(__x, __y); }
697 
698  constexpr bool
699  isgreaterequal(double __x, double __y)
700  { return __builtin_isgreaterequal(__x, __y); }
701 
702  constexpr bool
703  isgreaterequal(long double __x, long double __y)
704  { return __builtin_isgreaterequal(__x, __y); }
705 
706  template<typename _Tp, typename _Up>
707  constexpr typename
708  __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
709  && __is_arithmetic<_Up>::__value), bool>::__type
710  isgreaterequal(_Tp __x, _Up __y)
711  {
712  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
713  return __builtin_isgreaterequal(__type(__x), __type(__y));
714  }
715 
716  constexpr bool
717  isless(float __x, float __y)
718  { return __builtin_isless(__x, __y); }
719 
720  constexpr bool
721  isless(double __x, double __y)
722  { return __builtin_isless(__x, __y); }
723 
724  constexpr bool
725  isless(long double __x, long double __y)
726  { return __builtin_isless(__x, __y); }
727 
728  template<typename _Tp, typename _Up>
729  constexpr typename
730  __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
731  && __is_arithmetic<_Up>::__value), bool>::__type
732  isless(_Tp __x, _Up __y)
733  {
734  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
735  return __builtin_isless(__type(__x), __type(__y));
736  }
737 
738  constexpr bool
739  islessequal(float __x, float __y)
740  { return __builtin_islessequal(__x, __y); }
741 
742  constexpr bool
743  islessequal(double __x, double __y)
744  { return __builtin_islessequal(__x, __y); }
745 
746  constexpr bool
747  islessequal(long double __x, long double __y)
748  { return __builtin_islessequal(__x, __y); }
749 
750  template<typename _Tp, typename _Up>
751  constexpr typename
752  __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
753  && __is_arithmetic<_Up>::__value), bool>::__type
754  islessequal(_Tp __x, _Up __y)
755  {
756  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
757  return __builtin_islessequal(__type(__x), __type(__y));
758  }
759 
760  constexpr bool
761  islessgreater(float __x, float __y)
762  { return __builtin_islessgreater(__x, __y); }
763 
764  constexpr bool
765  islessgreater(double __x, double __y)
766  { return __builtin_islessgreater(__x, __y); }
767 
768  constexpr bool
769  islessgreater(long double __x, long double __y)
770  { return __builtin_islessgreater(__x, __y); }
771 
772  template<typename _Tp, typename _Up>
773  constexpr typename
774  __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
775  && __is_arithmetic<_Up>::__value), bool>::__type
776  islessgreater(_Tp __x, _Up __y)
777  {
778  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
779  return __builtin_islessgreater(__type(__x), __type(__y));
780  }
781 
782  constexpr bool
783  isunordered(float __x, float __y)
784  { return __builtin_isunordered(__x, __y); }
785 
786  constexpr bool
787  isunordered(double __x, double __y)
788  { return __builtin_isunordered(__x, __y); }
789 
790  constexpr bool
791  isunordered(long double __x, long double __y)
792  { return __builtin_isunordered(__x, __y); }
793 
794  template<typename _Tp, typename _Up>
795  constexpr typename
796  __gnu_cxx::__enable_if<(__is_arithmetic<_Tp>::__value
797  && __is_arithmetic<_Up>::__value), bool>::__type
798  isunordered(_Tp __x, _Up __y)
799  {
800  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
801  return __builtin_isunordered(__type(__x), __type(__y));
802  }
803 
804 #else
805 
806  template<typename _Tp>
807  inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
808  int>::__type
809  fpclassify(_Tp __f)
810  {
811  typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
812  return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
813  FP_SUBNORMAL, FP_ZERO, __type(__f));
814  }
815 
816  template<typename _Tp>
817  inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
818  int>::__type
819  isfinite(_Tp __f)
820  {
821  typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
822  return __builtin_isfinite(__type(__f));
823  }
824 
825  template<typename _Tp>
826  inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
827  int>::__type
828  isinf(_Tp __f)
829  {
830  typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
831  return __builtin_isinf(__type(__f));
832  }
833 
834  template<typename _Tp>
835  inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
836  int>::__type
837  isnan(_Tp __f)
838  {
839  typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
840  return __builtin_isnan(__type(__f));
841  }
842 
843  template<typename _Tp>
844  inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
845  int>::__type
846  isnormal(_Tp __f)
847  {
848  typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
849  return __builtin_isnormal(__type(__f));
850  }
851 
852  template<typename _Tp>
853  inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
854  int>::__type
855  signbit(_Tp __f)
856  {
857  typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
858  return sizeof(__type) == sizeof(float)
859  ? __builtin_signbitf(__type(__f))
860  : sizeof(__type) == sizeof(double)
861  ? __builtin_signbit(__type(__f))
862  : __builtin_signbitl(__type(__f));
863  }
864 
865  template<typename _Tp>
866  inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
867  int>::__type
868  isgreater(_Tp __f1, _Tp __f2)
869  {
870  typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
871  return __builtin_isgreater(__type(__f1), __type(__f2));
872  }
873 
874  template<typename _Tp>
875  inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
876  int>::__type
877  isgreaterequal(_Tp __f1, _Tp __f2)
878  {
879  typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
880  return __builtin_isgreaterequal(__type(__f1), __type(__f2));
881  }
882 
883  template<typename _Tp>
884  inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
885  int>::__type
886  isless(_Tp __f1, _Tp __f2)
887  {
888  typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
889  return __builtin_isless(__type(__f1), __type(__f2));
890  }
891 
892  template<typename _Tp>
893  inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
894  int>::__type
895  islessequal(_Tp __f1, _Tp __f2)
896  {
897  typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
898  return __builtin_islessequal(__type(__f1), __type(__f2));
899  }
900 
901  template<typename _Tp>
902  inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
903  int>::__type
904  islessgreater(_Tp __f1, _Tp __f2)
905  {
906  typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
907  return __builtin_islessgreater(__type(__f1), __type(__f2));
908  }
909 
910  template<typename _Tp>
911  inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
912  int>::__type
913  isunordered(_Tp __f1, _Tp __f2)
914  {
915  typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
916  return __builtin_isunordered(__type(__f1), __type(__f2));
917  }
918 
919 #endif
920 
921 _GLIBCXX_END_NAMESPACE_VERSION
922 } // namespace
923 
924 #endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */
925 #endif
926 
927 #if __cplusplus >= 201103L
928 
929 #ifdef _GLIBCXX_USE_C99_MATH_TR1
930 
931 #undef acosh
932 #undef acoshf
933 #undef acoshl
934 #undef asinh
935 #undef asinhf
936 #undef asinhl
937 #undef atanh
938 #undef atanhf
939 #undef atanhl
940 #undef cbrt
941 #undef cbrtf
942 #undef cbrtl
943 #undef copysign
944 #undef copysignf
945 #undef copysignl
946 #undef erf
947 #undef erff
948 #undef erfl
949 #undef erfc
950 #undef erfcf
951 #undef erfcl
952 #undef exp2
953 #undef exp2f
954 #undef exp2l
955 #undef expm1
956 #undef expm1f
957 #undef expm1l
958 #undef fdim
959 #undef fdimf
960 #undef fdiml
961 #undef fma
962 #undef fmaf
963 #undef fmal
964 #undef fmax
965 #undef fmaxf
966 #undef fmaxl
967 #undef fmin
968 #undef fminf
969 #undef fminl
970 #undef hypot
971 #undef hypotf
972 #undef hypotl
973 #undef ilogb
974 #undef ilogbf
975 #undef ilogbl
976 #undef lgamma
977 #undef lgammaf
978 #undef lgammal
979 #undef llrint
980 #undef llrintf
981 #undef llrintl
982 #undef llround
983 #undef llroundf
984 #undef llroundl
985 #undef log1p
986 #undef log1pf
987 #undef log1pl
988 #undef log2
989 #undef log2f
990 #undef log2l
991 #undef logb
992 #undef logbf
993 #undef logbl
994 #undef lrint
995 #undef lrintf
996 #undef lrintl
997 #undef lround
998 #undef lroundf
999 #undef lroundl
1000 #undef nan
1001 #undef nanf
1002 #undef nanl
1003 #undef nearbyint
1004 #undef nearbyintf
1005 #undef nearbyintl
1006 #undef nextafter
1007 #undef nextafterf
1008 #undef nextafterl
1009 #undef nexttoward
1010 #undef nexttowardf
1011 #undef nexttowardl
1012 #undef remainder
1013 #undef remainderf
1014 #undef remainderl
1015 #undef remquo
1016 #undef remquof
1017 #undef remquol
1018 #undef rint
1019 #undef rintf
1020 #undef rintl
1021 #undef round
1022 #undef roundf
1023 #undef roundl
1024 #undef scalbln
1025 #undef scalblnf
1026 #undef scalblnl
1027 #undef scalbn
1028 #undef scalbnf
1029 #undef scalbnl
1030 #undef tgamma
1031 #undef tgammaf
1032 #undef tgammal
1033 #undef trunc
1034 #undef truncf
1035 #undef truncl
1036 
1037 namespace std _GLIBCXX_VISIBILITY(default)
1038 {
1039 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1040 
1041  // types
1042  using ::double_t;
1043  using ::float_t;
1044 
1045  // functions
1046  using ::acosh;
1047  using ::acoshf;
1048  using ::acoshl;
1049 
1050  using ::asinh;
1051  using ::asinhf;
1052  using ::asinhl;
1053 
1054  using ::atanh;
1055  using ::atanhf;
1056  using ::atanhl;
1057 
1058  using ::cbrt;
1059  using ::cbrtf;
1060  using ::cbrtl;
1061 
1062  using ::copysign;
1063  using ::copysignf;
1064  using ::copysignl;
1065 
1066  using ::erf;
1067  using ::erff;
1068  using ::erfl;
1069 
1070  using ::erfc;
1071  using ::erfcf;
1072  using ::erfcl;
1073 
1074  using ::exp2;
1075  using ::exp2f;
1076  using ::exp2l;
1077 
1078  using ::expm1;
1079  using ::expm1f;
1080  using ::expm1l;
1081 
1082  using ::fdim;
1083  using ::fdimf;
1084  using ::fdiml;
1085 
1086  using ::fma;
1087  using ::fmaf;
1088  using ::fmal;
1089 
1090  using ::fmax;
1091  using ::fmaxf;
1092  using ::fmaxl;
1093 
1094  using ::fmin;
1095  using ::fminf;
1096  using ::fminl;
1097 
1098  using ::hypot;
1099  using ::hypotf;
1100  using ::hypotl;
1101 
1102  using ::ilogb;
1103  using ::ilogbf;
1104  using ::ilogbl;
1105 
1106  using ::lgamma;
1107  using ::lgammaf;
1108  using ::lgammal;
1109 
1110  using ::llrint;
1111  using ::llrintf;
1112  using ::llrintl;
1113 
1114  using ::llround;
1115  using ::llroundf;
1116  using ::llroundl;
1117 
1118  using ::log1p;
1119  using ::log1pf;
1120  using ::log1pl;
1121 
1122  using ::log2;
1123  using ::log2f;
1124  using ::log2l;
1125 
1126  using ::logb;
1127  using ::logbf;
1128  using ::logbl;
1129 
1130  using ::lrint;
1131  using ::lrintf;
1132  using ::lrintl;
1133 
1134  using ::lround;
1135  using ::lroundf;
1136  using ::lroundl;
1137 
1138  using ::nan;
1139  using ::nanf;
1140  using ::nanl;
1141 
1142  using ::nearbyint;
1143  using ::nearbyintf;
1144  using ::nearbyintl;
1145 
1146  using ::nextafter;
1147  using ::nextafterf;
1148  using ::nextafterl;
1149 
1150  using ::nexttoward;
1151  using ::nexttowardf;
1152  using ::nexttowardl;
1153 
1154  using ::remainder;
1155  using ::remainderf;
1156  using ::remainderl;
1157 
1158  using ::remquo;
1159  using ::remquof;
1160  using ::remquol;
1161 
1162  using ::rint;
1163  using ::rintf;
1164  using ::rintl;
1165 
1166  using ::round;
1167  using ::roundf;
1168  using ::roundl;
1169 
1170  using ::scalbln;
1171  using ::scalblnf;
1172  using ::scalblnl;
1173 
1174  using ::scalbn;
1175  using ::scalbnf;
1176  using ::scalbnl;
1177 
1178  using ::tgamma;
1179  using ::tgammaf;
1180  using ::tgammal;
1181 
1182  using ::trunc;
1183  using ::truncf;
1184  using ::truncl;
1185 
1186  /// Additional overloads.
1187  constexpr float
1188  acosh(float __x)
1189  { return __builtin_acoshf(__x); }
1190 
1191  constexpr long double
1192  acosh(long double __x)
1193  { return __builtin_acoshl(__x); }
1194 
1195  template<typename _Tp>
1196  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1197  double>::__type
1198  acosh(_Tp __x)
1199  { return __builtin_acosh(__x); }
1200 
1201  constexpr float
1202  asinh(float __x)
1203  { return __builtin_asinhf(__x); }
1204 
1205  constexpr long double
1206  asinh(long double __x)
1207  { return __builtin_asinhl(__x); }
1208 
1209  template<typename _Tp>
1210  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1211  double>::__type
1212  asinh(_Tp __x)
1213  { return __builtin_asinh(__x); }
1214 
1215  constexpr float
1216  atanh(float __x)
1217  { return __builtin_atanhf(__x); }
1218 
1219  constexpr long double
1220  atanh(long double __x)
1221  { return __builtin_atanhl(__x); }
1222 
1223  template<typename _Tp>
1224  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1225  double>::__type
1226  atanh(_Tp __x)
1227  { return __builtin_atanh(__x); }
1228 
1229  constexpr float
1230  cbrt(float __x)
1231  { return __builtin_cbrtf(__x); }
1232 
1233  constexpr long double
1234  cbrt(long double __x)
1235  { return __builtin_cbrtl(__x); }
1236 
1237  template<typename _Tp>
1238  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1239  double>::__type
1240  cbrt(_Tp __x)
1241  { return __builtin_cbrt(__x); }
1242 
1243  constexpr float
1244  copysign(float __x, float __y)
1245  { return __builtin_copysignf(__x, __y); }
1246 
1247  constexpr long double
1248  copysign(long double __x, long double __y)
1249  { return __builtin_copysignl(__x, __y); }
1250 
1251  template<typename _Tp, typename _Up>
1252  constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1253  copysign(_Tp __x, _Up __y)
1254  {
1255  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1256  return copysign(__type(__x), __type(__y));
1257  }
1258 
1259  constexpr float
1260  erf(float __x)
1261  { return __builtin_erff(__x); }
1262 
1263  constexpr long double
1264  erf(long double __x)
1265  { return __builtin_erfl(__x); }
1266 
1267  template<typename _Tp>
1268  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1269  double>::__type
1270  erf(_Tp __x)
1271  { return __builtin_erf(__x); }
1272 
1273  constexpr float
1274  erfc(float __x)
1275  { return __builtin_erfcf(__x); }
1276 
1277  constexpr long double
1278  erfc(long double __x)
1279  { return __builtin_erfcl(__x); }
1280 
1281  template<typename _Tp>
1282  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1283  double>::__type
1284  erfc(_Tp __x)
1285  { return __builtin_erfc(__x); }
1286 
1287  constexpr float
1288  exp2(float __x)
1289  { return __builtin_exp2f(__x); }
1290 
1291  constexpr long double
1292  exp2(long double __x)
1293  { return __builtin_exp2l(__x); }
1294 
1295  template<typename _Tp>
1296  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1297  double>::__type
1298  exp2(_Tp __x)
1299  { return __builtin_exp2(__x); }
1300 
1301  constexpr float
1302  expm1(float __x)
1303  { return __builtin_expm1f(__x); }
1304 
1305  constexpr long double
1306  expm1(long double __x)
1307  { return __builtin_expm1l(__x); }
1308 
1309  template<typename _Tp>
1310  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1311  double>::__type
1312  expm1(_Tp __x)
1313  { return __builtin_expm1(__x); }
1314 
1315  constexpr float
1316  fdim(float __x, float __y)
1317  { return __builtin_fdimf(__x, __y); }
1318 
1319  constexpr long double
1320  fdim(long double __x, long double __y)
1321  { return __builtin_fdiml(__x, __y); }
1322 
1323  template<typename _Tp, typename _Up>
1324  constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1325  fdim(_Tp __x, _Up __y)
1326  {
1327  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1328  return fdim(__type(__x), __type(__y));
1329  }
1330 
1331  constexpr float
1332  fma(float __x, float __y, float __z)
1333  { return __builtin_fmaf(__x, __y, __z); }
1334 
1335  constexpr long double
1336  fma(long double __x, long double __y, long double __z)
1337  { return __builtin_fmal(__x, __y, __z); }
1338 
1339  template<typename _Tp, typename _Up, typename _Vp>
1340  constexpr typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
1341  fma(_Tp __x, _Up __y, _Vp __z)
1342  {
1343  typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
1344  return fma(__type(__x), __type(__y), __type(__z));
1345  }
1346 
1347  constexpr float
1348  fmax(float __x, float __y)
1349  { return __builtin_fmaxf(__x, __y); }
1350 
1351  constexpr long double
1352  fmax(long double __x, long double __y)
1353  { return __builtin_fmaxl(__x, __y); }
1354 
1355  template<typename _Tp, typename _Up>
1356  constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1357  fmax(_Tp __x, _Up __y)
1358  {
1359  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1360  return fmax(__type(__x), __type(__y));
1361  }
1362 
1363  constexpr float
1364  fmin(float __x, float __y)
1365  { return __builtin_fminf(__x, __y); }
1366 
1367  constexpr long double
1368  fmin(long double __x, long double __y)
1369  { return __builtin_fminl(__x, __y); }
1370 
1371  template<typename _Tp, typename _Up>
1372  constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1373  fmin(_Tp __x, _Up __y)
1374  {
1375  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1376  return fmin(__type(__x), __type(__y));
1377  }
1378 
1379  constexpr float
1380  hypot(float __x, float __y)
1381  { return __builtin_hypotf(__x, __y); }
1382 
1383  constexpr long double
1384  hypot(long double __x, long double __y)
1385  { return __builtin_hypotl(__x, __y); }
1386 
1387  template<typename _Tp, typename _Up>
1388  constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1389  hypot(_Tp __x, _Up __y)
1390  {
1391  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1392  return hypot(__type(__x), __type(__y));
1393  }
1394 
1395  constexpr int
1396  ilogb(float __x)
1397  { return __builtin_ilogbf(__x); }
1398 
1399  constexpr int
1400  ilogb(long double __x)
1401  { return __builtin_ilogbl(__x); }
1402 
1403  template<typename _Tp>
1404  constexpr
1405  typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1406  int>::__type
1407  ilogb(_Tp __x)
1408  { return __builtin_ilogb(__x); }
1409 
1410  constexpr float
1411  lgamma(float __x)
1412  { return __builtin_lgammaf(__x); }
1413 
1414  constexpr long double
1415  lgamma(long double __x)
1416  { return __builtin_lgammal(__x); }
1417 
1418  template<typename _Tp>
1419  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1420  double>::__type
1421  lgamma(_Tp __x)
1422  { return __builtin_lgamma(__x); }
1423 
1424  constexpr long long
1425  llrint(float __x)
1426  { return __builtin_llrintf(__x); }
1427 
1428  constexpr long long
1429  llrint(long double __x)
1430  { return __builtin_llrintl(__x); }
1431 
1432  template<typename _Tp>
1433  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1434  long long>::__type
1435  llrint(_Tp __x)
1436  { return __builtin_llrint(__x); }
1437 
1438  constexpr long long
1439  llround(float __x)
1440  { return __builtin_llroundf(__x); }
1441 
1442  constexpr long long
1443  llround(long double __x)
1444  { return __builtin_llroundl(__x); }
1445 
1446  template<typename _Tp>
1447  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1448  long long>::__type
1449  llround(_Tp __x)
1450  { return __builtin_llround(__x); }
1451 
1452  constexpr float
1453  log1p(float __x)
1454  { return __builtin_log1pf(__x); }
1455 
1456  constexpr long double
1457  log1p(long double __x)
1458  { return __builtin_log1pl(__x); }
1459 
1460  template<typename _Tp>
1461  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1462  double>::__type
1463  log1p(_Tp __x)
1464  { return __builtin_log1p(__x); }
1465 
1466  // DR 568.
1467  constexpr float
1468  log2(float __x)
1469  { return __builtin_log2f(__x); }
1470 
1471  constexpr long double
1472  log2(long double __x)
1473  { return __builtin_log2l(__x); }
1474 
1475  template<typename _Tp>
1476  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1477  double>::__type
1478  log2(_Tp __x)
1479  { return __builtin_log2(__x); }
1480 
1481  constexpr float
1482  logb(float __x)
1483  { return __builtin_logbf(__x); }
1484 
1485  constexpr long double
1486  logb(long double __x)
1487  { return __builtin_logbl(__x); }
1488 
1489  template<typename _Tp>
1490  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1491  double>::__type
1492  logb(_Tp __x)
1493  { return __builtin_logb(__x); }
1494 
1495  constexpr long
1496  lrint(float __x)
1497  { return __builtin_lrintf(__x); }
1498 
1499  constexpr long
1500  lrint(long double __x)
1501  { return __builtin_lrintl(__x); }
1502 
1503  template<typename _Tp>
1504  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1505  long>::__type
1506  lrint(_Tp __x)
1507  { return __builtin_lrint(__x); }
1508 
1509  constexpr long
1510  lround(float __x)
1511  { return __builtin_lroundf(__x); }
1512 
1513  constexpr long
1514  lround(long double __x)
1515  { return __builtin_lroundl(__x); }
1516 
1517  template<typename _Tp>
1518  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1519  long>::__type
1520  lround(_Tp __x)
1521  { return __builtin_lround(__x); }
1522 
1523  constexpr float
1524  nearbyint(float __x)
1525  { return __builtin_nearbyintf(__x); }
1526 
1527  constexpr long double
1528  nearbyint(long double __x)
1529  { return __builtin_nearbyintl(__x); }
1530 
1531  template<typename _Tp>
1532  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1533  double>::__type
1534  nearbyint(_Tp __x)
1535  { return __builtin_nearbyint(__x); }
1536 
1537  constexpr float
1538  nextafter(float __x, float __y)
1539  { return __builtin_nextafterf(__x, __y); }
1540 
1541  constexpr long double
1542  nextafter(long double __x, long double __y)
1543  { return __builtin_nextafterl(__x, __y); }
1544 
1545  template<typename _Tp, typename _Up>
1546  constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1547  nextafter(_Tp __x, _Up __y)
1548  {
1549  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1550  return nextafter(__type(__x), __type(__y));
1551  }
1552 
1553  constexpr float
1554  nexttoward(float __x, long double __y)
1555  { return __builtin_nexttowardf(__x, __y); }
1556 
1557  constexpr long double
1558  nexttoward(long double __x, long double __y)
1559  { return __builtin_nexttowardl(__x, __y); }
1560 
1561  template<typename _Tp>
1562  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1563  double>::__type
1564  nexttoward(_Tp __x, long double __y)
1565  { return __builtin_nexttoward(__x, __y); }
1566 
1567  constexpr float
1568  remainder(float __x, float __y)
1569  { return __builtin_remainderf(__x, __y); }
1570 
1571  constexpr long double
1572  remainder(long double __x, long double __y)
1573  { return __builtin_remainderl(__x, __y); }
1574 
1575  template<typename _Tp, typename _Up>
1576  constexpr typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1577  remainder(_Tp __x, _Up __y)
1578  {
1579  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1580  return remainder(__type(__x), __type(__y));
1581  }
1582 
1583  inline float
1584  remquo(float __x, float __y, int* __pquo)
1585  { return __builtin_remquof(__x, __y, __pquo); }
1586 
1587  inline long double
1588  remquo(long double __x, long double __y, int* __pquo)
1589  { return __builtin_remquol(__x, __y, __pquo); }
1590 
1591  template<typename _Tp, typename _Up>
1592  inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1593  remquo(_Tp __x, _Up __y, int* __pquo)
1594  {
1595  typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1596  return remquo(__type(__x), __type(__y), __pquo);
1597  }
1598 
1599  constexpr float
1600  rint(float __x)
1601  { return __builtin_rintf(__x); }
1602 
1603  constexpr long double
1604  rint(long double __x)
1605  { return __builtin_rintl(__x); }
1606 
1607  template<typename _Tp>
1608  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1609  double>::__type
1610  rint(_Tp __x)
1611  { return __builtin_rint(__x); }
1612 
1613  constexpr float
1614  round(float __x)
1615  { return __builtin_roundf(__x); }
1616 
1617  constexpr long double
1618  round(long double __x)
1619  { return __builtin_roundl(__x); }
1620 
1621  template<typename _Tp>
1622  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1623  double>::__type
1624  round(_Tp __x)
1625  { return __builtin_round(__x); }
1626 
1627  constexpr float
1628  scalbln(float __x, long __ex)
1629  { return __builtin_scalblnf(__x, __ex); }
1630 
1631  constexpr long double
1632  scalbln(long double __x, long __ex)
1633  { return __builtin_scalblnl(__x, __ex); }
1634 
1635  template<typename _Tp>
1636  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1637  double>::__type
1638  scalbln(_Tp __x, long __ex)
1639  { return __builtin_scalbln(__x, __ex); }
1640 
1641  constexpr float
1642  scalbn(float __x, int __ex)
1643  { return __builtin_scalbnf(__x, __ex); }
1644 
1645  constexpr long double
1646  scalbn(long double __x, int __ex)
1647  { return __builtin_scalbnl(__x, __ex); }
1648 
1649  template<typename _Tp>
1650  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1651  double>::__type
1652  scalbn(_Tp __x, int __ex)
1653  { return __builtin_scalbn(__x, __ex); }
1654 
1655  constexpr float
1656  tgamma(float __x)
1657  { return __builtin_tgammaf(__x); }
1658 
1659  constexpr long double
1660  tgamma(long double __x)
1661  { return __builtin_tgammal(__x); }
1662 
1663  template<typename _Tp>
1664  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1665  double>::__type
1666  tgamma(_Tp __x)
1667  { return __builtin_tgamma(__x); }
1668 
1669  constexpr float
1670  trunc(float __x)
1671  { return __builtin_truncf(__x); }
1672 
1673  constexpr long double
1674  trunc(long double __x)
1675  { return __builtin_truncl(__x); }
1676 
1677  template<typename _Tp>
1678  constexpr typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value,
1679  double>::__type
1680  trunc(_Tp __x)
1681  { return __builtin_trunc(__x); }
1682 
1683 _GLIBCXX_END_NAMESPACE_VERSION
1684 } // namespace
1685 
1686 #endif // _GLIBCXX_USE_C99_MATH_TR1
1687 
1688 #endif // C++11
1689 
1690 #endif