gcc50: Disconnect from buildworld.
[dragonfly.git] / contrib / gcc-5.0 / libstdc++-v3 / include / tr1 / cmath
1 // TR1 cmath -*- C++ -*-
2
3 // Copyright (C) 2006-2015 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 tr1/cmath
26  *  This is a TR1 C++ Library header. 
27  */
28
29 #ifndef _GLIBCXX_TR1_CMATH
30 #define _GLIBCXX_TR1_CMATH 1
31
32 #pragma GCC system_header
33
34 #include <cmath>
35
36 #ifdef _GLIBCXX_USE_C99_MATH_TR1
37
38 #undef acosh
39 #undef acoshf
40 #undef acoshl
41 #undef asinh
42 #undef asinhf
43 #undef asinhl
44 #undef atanh
45 #undef atanhf
46 #undef atanhl
47 #undef cbrt
48 #undef cbrtf
49 #undef cbrtl
50 #undef copysign
51 #undef copysignf
52 #undef copysignl
53 #undef erf
54 #undef erff
55 #undef erfl
56 #undef erfc
57 #undef erfcf
58 #undef erfcl
59 #undef exp2
60 #undef exp2f
61 #undef exp2l
62 #undef expm1
63 #undef expm1f
64 #undef expm1l
65 #undef fdim
66 #undef fdimf
67 #undef fdiml
68 #undef fma
69 #undef fmaf
70 #undef fmal
71 #undef fmax
72 #undef fmaxf
73 #undef fmaxl
74 #undef fmin
75 #undef fminf
76 #undef fminl
77 #undef hypot
78 #undef hypotf
79 #undef hypotl
80 #undef ilogb
81 #undef ilogbf
82 #undef ilogbl
83 #undef lgamma
84 #undef lgammaf
85 #undef lgammal
86 #undef llrint
87 #undef llrintf
88 #undef llrintl
89 #undef llround
90 #undef llroundf
91 #undef llroundl
92 #undef log1p
93 #undef log1pf
94 #undef log1pl
95 #undef log2
96 #undef log2f
97 #undef log2l
98 #undef logb
99 #undef logbf
100 #undef logbl
101 #undef lrint
102 #undef lrintf
103 #undef lrintl
104 #undef lround
105 #undef lroundf
106 #undef lroundl
107 #undef nan
108 #undef nanf
109 #undef nanl
110 #undef nearbyint
111 #undef nearbyintf
112 #undef nearbyintl
113 #undef nextafter
114 #undef nextafterf
115 #undef nextafterl
116 #undef nexttoward
117 #undef nexttowardf
118 #undef nexttowardl
119 #undef remainder
120 #undef remainderf
121 #undef remainderl
122 #undef remquo
123 #undef remquof
124 #undef remquol
125 #undef rint
126 #undef rintf
127 #undef rintl
128 #undef round
129 #undef roundf
130 #undef roundl
131 #undef scalbln
132 #undef scalblnf
133 #undef scalblnl
134 #undef scalbn
135 #undef scalbnf
136 #undef scalbnl
137 #undef tgamma
138 #undef tgammaf
139 #undef tgammal
140 #undef trunc
141 #undef truncf
142 #undef truncl
143
144 #endif
145
146 namespace std _GLIBCXX_VISIBILITY(default)
147 {
148 namespace tr1
149 {
150 _GLIBCXX_BEGIN_NAMESPACE_VERSION
151
152 #if _GLIBCXX_USE_C99_MATH_TR1
153
154   // types
155   using ::double_t;
156   using ::float_t;
157
158   // functions
159   using ::acosh;
160   using ::acoshf;
161   using ::acoshl;
162
163   using ::asinh;
164   using ::asinhf;
165   using ::asinhl;
166
167   using ::atanh;
168   using ::atanhf;
169   using ::atanhl;
170
171   using ::cbrt;
172   using ::cbrtf;
173   using ::cbrtl;
174
175   using ::copysign;
176   using ::copysignf;
177   using ::copysignl;
178
179   using ::erf;
180   using ::erff;
181   using ::erfl;
182
183   using ::erfc;
184   using ::erfcf;
185   using ::erfcl;
186
187   using ::exp2;
188   using ::exp2f;
189   using ::exp2l;
190
191   using ::expm1;
192   using ::expm1f;
193   using ::expm1l;
194
195   using ::fdim;
196   using ::fdimf;
197   using ::fdiml;
198
199   using ::fma;
200   using ::fmaf;
201   using ::fmal;
202
203   using ::fmax;
204   using ::fmaxf;
205   using ::fmaxl;
206
207   using ::fmin;
208   using ::fminf;
209   using ::fminl;
210
211   using ::hypot;
212   using ::hypotf;
213   using ::hypotl;
214
215   using ::ilogb;
216   using ::ilogbf;
217   using ::ilogbl;
218
219   using ::lgamma;
220   using ::lgammaf;
221   using ::lgammal;
222
223   using ::llrint;
224   using ::llrintf;
225   using ::llrintl;
226
227   using ::llround;
228   using ::llroundf;
229   using ::llroundl;
230
231   using ::log1p;
232   using ::log1pf;
233   using ::log1pl;
234
235   using ::log2;
236   using ::log2f;
237   using ::log2l;
238
239   using ::logb;
240   using ::logbf;
241   using ::logbl;
242
243   using ::lrint;
244   using ::lrintf;
245   using ::lrintl;
246
247   using ::lround;
248   using ::lroundf;
249   using ::lroundl;
250
251   using ::nan;
252   using ::nanf;
253   using ::nanl;
254
255   using ::nearbyint;
256   using ::nearbyintf;
257   using ::nearbyintl;
258
259   using ::nextafter;
260   using ::nextafterf;
261   using ::nextafterl;
262
263   using ::nexttoward;
264   using ::nexttowardf;
265   using ::nexttowardl;
266
267   using ::remainder;
268   using ::remainderf;
269   using ::remainderl;
270
271   using ::remquo;
272   using ::remquof;
273   using ::remquol;
274
275   using ::rint;
276   using ::rintf;
277   using ::rintl;
278
279   using ::round;
280   using ::roundf;
281   using ::roundl;
282
283   using ::scalbln;
284   using ::scalblnf;
285   using ::scalblnl;
286
287   using ::scalbn;
288   using ::scalbnf;
289   using ::scalbnl;
290
291   using ::tgamma;
292   using ::tgammaf;
293   using ::tgammal;
294
295   using ::trunc;
296   using ::truncf;
297   using ::truncl;
298
299 #endif
300
301 #if _GLIBCXX_USE_C99_MATH
302 #if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
303
304   /// Function template definitions [8.16.3].
305   template<typename _Tp>
306     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
307                                            int>::__type
308     fpclassify(_Tp __f)
309     {
310       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
311       return __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL,
312                                   FP_SUBNORMAL, FP_ZERO, __type(__f));
313     }
314
315   template<typename _Tp>
316     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
317                                            int>::__type
318     isfinite(_Tp __f)
319     {
320       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
321       return __builtin_isfinite(__type(__f));
322     }
323
324   template<typename _Tp>
325     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
326                                            int>::__type
327     isinf(_Tp __f)
328     {
329       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
330       return __builtin_isinf(__type(__f));
331     }
332
333   template<typename _Tp>
334     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
335                                            int>::__type
336     isnan(_Tp __f)
337     {
338       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
339       return __builtin_isnan(__type(__f));
340     }
341
342   template<typename _Tp>
343     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
344                                            int>::__type
345     isnormal(_Tp __f)
346     {
347       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
348       return __builtin_isnormal(__type(__f));
349     }
350
351   template<typename _Tp>
352     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
353                                            int>::__type
354     signbit(_Tp __f)
355     {
356       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
357       return __builtin_signbit(__type(__f));
358     }
359
360   template<typename _Tp>
361     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
362                                            int>::__type
363     isgreater(_Tp __f1, _Tp __f2)
364     {
365       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
366       return __builtin_isgreater(__type(__f1), __type(__f2));
367     }
368
369   template<typename _Tp>
370     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
371                                            int>::__type
372     isgreaterequal(_Tp __f1, _Tp __f2)
373     {
374       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
375       return __builtin_isgreaterequal(__type(__f1), __type(__f2));
376     }
377
378   template<typename _Tp>
379     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
380                                            int>::__type
381     isless(_Tp __f1, _Tp __f2)
382     {
383       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
384       return __builtin_isless(__type(__f1), __type(__f2));
385     }
386
387   template<typename _Tp>
388     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
389                                            int>::__type
390     islessequal(_Tp __f1, _Tp __f2)
391     {
392       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
393       return __builtin_islessequal(__type(__f1), __type(__f2));
394     }
395
396   template<typename _Tp>
397     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
398                                            int>::__type
399     islessgreater(_Tp __f1, _Tp __f2)
400     {
401       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
402       return __builtin_islessgreater(__type(__f1), __type(__f2));
403     }
404
405   template<typename _Tp>
406     inline typename __gnu_cxx::__enable_if<__is_arithmetic<_Tp>::__value,
407                                            int>::__type
408     isunordered(_Tp __f1, _Tp __f2)
409     {
410       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
411       return __builtin_isunordered(__type(__f1), __type(__f2));
412     }
413
414 #endif
415 #endif
416
417 #if _GLIBCXX_USE_C99_MATH_TR1
418
419   /// Additional overloads [8.16.4].
420   using std::acos;
421
422 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
423   inline float
424   acosh(float __x)
425   { return __builtin_acoshf(__x); }
426
427   inline long double
428   acosh(long double __x)
429   { return __builtin_acoshl(__x); }
430 #endif
431
432   template<typename _Tp>
433     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
434                                            double>::__type
435     acosh(_Tp __x)
436     { return __builtin_acosh(__x); }
437
438   using std::asin;
439
440 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
441   inline float
442   asinh(float __x)
443   { return __builtin_asinhf(__x); }
444
445   inline long double
446   asinh(long double __x)
447   { return __builtin_asinhl(__x); }
448 #endif
449
450   template<typename _Tp>
451     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
452                                            double>::__type
453     asinh(_Tp __x)
454     { return __builtin_asinh(__x); }
455
456   using std::atan;
457   using std::atan2;
458
459 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
460   inline float
461   atanh(float __x)
462   { return __builtin_atanhf(__x); }
463
464   inline long double
465   atanh(long double __x)
466   { return __builtin_atanhl(__x); }
467 #endif
468
469   template<typename _Tp>
470     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
471                                            double>::__type
472     atanh(_Tp __x)
473     { return __builtin_atanh(__x); }
474
475 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
476   inline float
477   cbrt(float __x)
478   { return __builtin_cbrtf(__x); }
479
480   inline long double
481   cbrt(long double __x)
482   { return __builtin_cbrtl(__x); }
483 #endif
484
485   template<typename _Tp>
486     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
487                                            double>::__type
488     cbrt(_Tp __x)
489     { return __builtin_cbrt(__x); }
490
491   using std::ceil;
492
493 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
494   inline float
495   copysign(float __x, float __y)
496   { return __builtin_copysignf(__x, __y); }
497
498   inline long double
499   copysign(long double __x, long double __y)
500   { return __builtin_copysignl(__x, __y); }
501 #endif
502
503   template<typename _Tp, typename _Up>
504     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
505     copysign(_Tp __x, _Up __y)
506     {
507       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
508       return copysign(__type(__x), __type(__y));
509     }
510
511   using std::cos;
512   using std::cosh;  
513
514 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
515   inline float
516   erf(float __x)
517   { return __builtin_erff(__x); }
518
519   inline long double
520   erf(long double __x)
521   { return __builtin_erfl(__x); }
522 #endif
523
524   template<typename _Tp>
525     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
526                                            double>::__type
527     erf(_Tp __x)
528     { return __builtin_erf(__x); }
529
530 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
531   inline float
532   erfc(float __x)
533   { return __builtin_erfcf(__x); }
534
535   inline long double
536   erfc(long double __x)
537   { return __builtin_erfcl(__x); }
538 #endif
539
540   template<typename _Tp>
541     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
542                                            double>::__type
543     erfc(_Tp __x)
544     { return __builtin_erfc(__x); }
545
546   using std::exp;
547
548 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
549   inline float
550   exp2(float __x)
551   { return __builtin_exp2f(__x); }
552
553   inline long double
554   exp2(long double __x)
555   { return __builtin_exp2l(__x); }
556 #endif
557
558   template<typename _Tp>
559     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
560                                            double>::__type
561     exp2(_Tp __x)
562     { return __builtin_exp2(__x); }
563
564 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
565   inline float
566   expm1(float __x)
567   { return __builtin_expm1f(__x); }
568
569   inline long double
570   expm1(long double __x)
571   { return __builtin_expm1l(__x); }
572 #endif
573
574   template<typename _Tp>
575     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
576                                            double>::__type
577     expm1(_Tp __x)
578     { return __builtin_expm1(__x); }
579
580   // Note: we deal with fabs in a special way, because an using std::fabs
581   // would bring in also the overloads for complex types, which in C++0x
582   // mode have a different return type.
583   // With __CORRECT_ISO_CPP_MATH_H_PROTO, math.h imports std::fabs in the
584   // global namespace after the declarations of the float / double / long
585   // double overloads but before the std::complex overloads.
586   using ::fabs;
587
588 #ifndef __CORRECT_ISO_CPP_MATH_H_PROTO
589 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
590   inline float
591   fabs(float __x)
592   { return __builtin_fabsf(__x); }
593
594   inline long double
595   fabs(long double __x)
596   { return __builtin_fabsl(__x); }
597 #endif
598
599   template<typename _Tp>
600     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
601                                            double>::__type
602     fabs(_Tp __x)
603     { return __builtin_fabs(__x); }
604 #endif
605
606 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
607   inline float
608   fdim(float __x, float __y)
609   { return __builtin_fdimf(__x, __y); }
610
611   inline long double
612   fdim(long double __x, long double __y)
613   { return __builtin_fdiml(__x, __y); }
614 #endif
615
616   template<typename _Tp, typename _Up>
617     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
618     fdim(_Tp __x, _Up __y)
619     {
620       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
621       return fdim(__type(__x), __type(__y));
622     }
623
624   using std::floor;
625
626 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
627   inline float
628   fma(float __x, float __y, float __z)
629   { return __builtin_fmaf(__x, __y, __z); }
630
631   inline long double
632   fma(long double __x, long double __y, long double __z)
633   { return __builtin_fmal(__x, __y, __z); }
634 #endif
635
636   template<typename _Tp, typename _Up, typename _Vp>
637     inline typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type
638     fma(_Tp __x, _Up __y, _Vp __z)
639     {
640       typedef typename __gnu_cxx::__promote_3<_Tp, _Up, _Vp>::__type __type;
641       return fma(__type(__x), __type(__y), __type(__z));
642     }
643
644 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
645   inline float
646   fmax(float __x, float __y)
647   { return __builtin_fmaxf(__x, __y); }
648
649   inline long double
650   fmax(long double __x, long double __y)
651   { return __builtin_fmaxl(__x, __y); }
652 #endif
653
654   template<typename _Tp, typename _Up>
655     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
656     fmax(_Tp __x, _Up __y)
657     {
658       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
659       return fmax(__type(__x), __type(__y));
660     }
661
662 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
663   inline float
664   fmin(float __x, float __y)
665   { return __builtin_fminf(__x, __y); }
666
667   inline long double
668   fmin(long double __x, long double __y)
669   { return __builtin_fminl(__x, __y); }
670 #endif
671
672   template<typename _Tp, typename _Up>
673     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
674     fmin(_Tp __x, _Up __y)
675     {
676       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
677       return fmin(__type(__x), __type(__y));
678     }
679
680   using std::fmod;
681   using std::frexp;
682
683 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
684   inline float
685   hypot(float __x, float __y)
686   { return __builtin_hypotf(__x, __y); }
687
688   inline long double
689   hypot(long double __x, long double __y)
690   { return __builtin_hypotl(__x, __y); }
691 #endif
692
693   template<typename _Tp, typename _Up>
694     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
695     hypot(_Tp __y, _Up __x)
696     {
697       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
698       return hypot(__type(__y), __type(__x));
699     }
700
701 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
702   inline int
703   ilogb(float __x)
704   { return __builtin_ilogbf(__x); }
705
706   inline int
707   ilogb(long double __x)
708   { return __builtin_ilogbl(__x); }
709 #endif
710
711   template<typename _Tp>
712     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
713                                            int>::__type
714     ilogb(_Tp __x)
715     { return __builtin_ilogb(__x); }
716
717   using std::ldexp;
718
719 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
720   inline float
721   lgamma(float __x)
722   { return __builtin_lgammaf(__x); }
723
724   inline long double
725   lgamma(long double __x)
726   { return __builtin_lgammal(__x); }
727 #endif
728
729   template<typename _Tp>
730     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
731                                            double>::__type
732     lgamma(_Tp __x)
733     { return __builtin_lgamma(__x); }
734
735 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
736   inline long long
737   llrint(float __x)
738   { return __builtin_llrintf(__x); }
739
740   inline long long
741   llrint(long double __x)
742   { return __builtin_llrintl(__x); }
743 #endif
744
745   template<typename _Tp>
746     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
747                                            long long>::__type
748     llrint(_Tp __x)
749     { return __builtin_llrint(__x); }
750
751 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
752   inline long long
753   llround(float __x)
754   { return __builtin_llroundf(__x); }
755
756   inline long long
757   llround(long double __x)
758   { return __builtin_llroundl(__x); }
759 #endif
760
761   template<typename _Tp>
762     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
763                                            long long>::__type
764     llround(_Tp __x)
765     { return __builtin_llround(__x); }
766
767   using std::log;
768   using std::log10;
769
770 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
771   inline float
772   log1p(float __x)
773   { return __builtin_log1pf(__x); }
774
775   inline long double
776   log1p(long double __x)
777   { return __builtin_log1pl(__x); }
778 #endif
779
780   template<typename _Tp>
781     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
782                                            double>::__type
783     log1p(_Tp __x)
784     { return __builtin_log1p(__x); }
785
786   // DR 568.
787 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
788   inline float
789   log2(float __x)
790   { return __builtin_log2f(__x); }
791
792   inline long double
793   log2(long double __x)
794   { return __builtin_log2l(__x); }
795 #endif
796
797   template<typename _Tp>
798     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
799                                            double>::__type
800     log2(_Tp __x)
801     { return __builtin_log2(__x); }
802
803 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
804   inline float
805   logb(float __x)
806   { return __builtin_logbf(__x); }
807
808   inline long double
809   logb(long double __x)
810   { return __builtin_logbl(__x); }
811 #endif
812
813   template<typename _Tp>
814     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
815                                            double>::__type
816     logb(_Tp __x)
817     {
818       return __builtin_logb(__x);
819     }
820
821 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
822   inline long
823   lrint(float __x)
824   { return __builtin_lrintf(__x); }
825
826   inline long
827   lrint(long double __x)
828   { return __builtin_lrintl(__x); }
829 #endif
830
831   template<typename _Tp>
832     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
833                                            long>::__type
834     lrint(_Tp __x)
835     { return __builtin_lrint(__x); }
836
837 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
838   inline long
839   lround(float __x)
840   { return __builtin_lroundf(__x); }
841
842   inline long
843   lround(long double __x)
844   { return __builtin_lroundl(__x); }
845 #endif
846
847   template<typename _Tp>
848     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
849                                            long>::__type
850     lround(_Tp __x)
851     { return __builtin_lround(__x); }
852
853 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
854   inline float
855   nearbyint(float __x)
856   { return __builtin_nearbyintf(__x); }
857
858   inline long double
859   nearbyint(long double __x)
860   { return __builtin_nearbyintl(__x); }
861 #endif
862
863   template<typename _Tp>
864     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
865                                            double>::__type
866     nearbyint(_Tp __x)
867     { return __builtin_nearbyint(__x); }
868
869 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
870   inline float
871   nextafter(float __x, float __y)
872   { return __builtin_nextafterf(__x, __y); }
873
874   inline long double
875   nextafter(long double __x, long double __y)
876   { return __builtin_nextafterl(__x, __y); }
877 #endif
878
879   template<typename _Tp, typename _Up>
880     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
881     nextafter(_Tp __x, _Up __y)
882     {
883       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
884       return nextafter(__type(__x), __type(__y));
885     }
886
887 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
888   inline float
889   nexttoward(float __x, long double __y)
890   { return __builtin_nexttowardf(__x, __y); }
891
892   inline long double
893   nexttoward(long double __x, long double __y)
894   { return __builtin_nexttowardl(__x, __y); }
895 #endif
896
897   template<typename _Tp>
898     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
899                                            double>::__type
900     nexttoward(_Tp __x, long double __y)
901     { return __builtin_nexttoward(__x, __y); }
902
903 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
904   inline float
905   remainder(float __x, float __y)
906   { return __builtin_remainderf(__x, __y); }
907
908   inline long double
909   remainder(long double __x, long double __y)
910   { return __builtin_remainderl(__x, __y); }
911 #endif
912
913   template<typename _Tp, typename _Up>
914     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
915     remainder(_Tp __x, _Up __y)
916     {
917       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
918       return remainder(__type(__x), __type(__y));
919     }
920
921 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
922   inline float
923   remquo(float __x, float __y, int* __pquo)
924   { return __builtin_remquof(__x, __y, __pquo); }
925
926   inline long double
927   remquo(long double __x, long double __y, int* __pquo)
928   { return __builtin_remquol(__x, __y, __pquo); }
929 #endif
930
931   template<typename _Tp, typename _Up>
932     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
933     remquo(_Tp __x, _Up __y, int* __pquo)
934     {
935       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
936       return remquo(__type(__x), __type(__y), __pquo);
937     }
938
939 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
940   inline float
941   rint(float __x)
942   { return __builtin_rintf(__x); }
943
944   inline long double
945   rint(long double __x)
946   { return __builtin_rintl(__x); }
947 #endif
948
949   template<typename _Tp>
950     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
951                                            double>::__type
952     rint(_Tp __x)
953     { return __builtin_rint(__x); }
954
955 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
956   inline float
957   round(float __x)
958   { return __builtin_roundf(__x); }
959
960   inline long double
961   round(long double __x)
962   { return __builtin_roundl(__x); }
963 #endif
964
965   template<typename _Tp>
966     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
967                                            double>::__type
968     round(_Tp __x)
969     { return __builtin_round(__x); }
970
971 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
972   inline float
973   scalbln(float __x, long __ex)
974   { return __builtin_scalblnf(__x, __ex); }
975
976   inline long double
977   scalbln(long double __x, long __ex)
978   { return __builtin_scalblnl(__x, __ex); }
979 #endif
980
981   template<typename _Tp>
982     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
983                                            double>::__type
984     scalbln(_Tp __x, long __ex)
985     { return __builtin_scalbln(__x, __ex); }
986  
987 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
988   inline float
989   scalbn(float __x, int __ex)
990   { return __builtin_scalbnf(__x, __ex); }
991
992   inline long double
993   scalbn(long double __x, int __ex)
994   { return __builtin_scalbnl(__x, __ex); }
995 #endif
996
997   template<typename _Tp>
998     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
999                                            double>::__type
1000     scalbn(_Tp __x, int __ex)
1001     { return __builtin_scalbn(__x, __ex); }
1002
1003   using std::sin;
1004   using std::sinh;
1005   using std::sqrt;
1006   using std::tan;
1007   using std::tanh;
1008
1009 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
1010   inline float
1011   tgamma(float __x)
1012   { return __builtin_tgammaf(__x); }
1013
1014   inline long double
1015   tgamma(long double __x)
1016   { return __builtin_tgammal(__x); }
1017 #endif
1018
1019   template<typename _Tp>
1020     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
1021                                            double>::__type
1022     tgamma(_Tp __x)
1023     { return __builtin_tgamma(__x); }
1024  
1025 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
1026   inline float
1027   trunc(float __x)
1028   { return __builtin_truncf(__x); }
1029
1030   inline long double
1031   trunc(long double __x)
1032   { return __builtin_truncl(__x); }
1033 #endif
1034
1035   template<typename _Tp>
1036     inline typename __gnu_cxx::__enable_if<__is_integer<_Tp>::__value, 
1037                                            double>::__type
1038     trunc(_Tp __x)
1039     { return __builtin_trunc(__x); }
1040
1041 #endif
1042 _GLIBCXX_END_NAMESPACE_VERSION
1043 }
1044 }
1045
1046 namespace std _GLIBCXX_VISIBILITY(default)
1047 {
1048 namespace tr1
1049 {
1050 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1051
1052   // DR 550. What should the return type of pow(float,int) be?
1053   // NB: C++0x and TR1 != C++03.
1054
1055   // The std::tr1::pow(double, double) overload cannot be provided
1056   // here, because it would clash with ::pow(double,double) declared
1057   // in <math.h>, if <tr1/math.h> is included at the same time (raised
1058   // by the fix of PR c++/54537). It is not possible either to use the
1059   // using-declaration 'using ::pow;' here, because if the user code
1060   // has a 'using std::pow;', it would bring the pow(*,int) averloads
1061   // in the tr1 namespace, which is undesirable. Consequently, the
1062   // solution is to forward std::tr1::pow(double,double) to
1063   // std::pow(double,double) via the templatized version below. See
1064   // the discussion about this issue here:
1065   // http://gcc.gnu.org/ml/gcc-patches/2012-09/msg01278.html
1066
1067 #ifndef __CORRECT_ISO_CPP11_MATH_H_PROTO
1068   inline float
1069   pow(float __x, float __y)
1070   { return std::pow(__x, __y); }
1071
1072   inline long double
1073   pow(long double __x, long double __y)
1074   { return std::pow(__x, __y); }
1075 #endif
1076
1077   template<typename _Tp, typename _Up>
1078     inline typename __gnu_cxx::__promote_2<_Tp, _Up>::__type
1079     pow(_Tp __x, _Up __y)
1080     {
1081       typedef typename __gnu_cxx::__promote_2<_Tp, _Up>::__type __type;
1082       return std::pow(__type(__x), __type(__y));
1083     }
1084
1085 _GLIBCXX_END_NAMESPACE_VERSION
1086 }
1087 }
1088
1089 #include <bits/stl_algobase.h>
1090 #include <limits>
1091 #include <tr1/type_traits>
1092
1093 #include <tr1/gamma.tcc>
1094 #include <tr1/bessel_function.tcc>
1095 #include <tr1/beta_function.tcc>
1096 #include <tr1/ell_integral.tcc>
1097 #include <tr1/exp_integral.tcc>
1098 #include <tr1/hypergeometric.tcc>
1099 #include <tr1/legendre_function.tcc>
1100 #include <tr1/modified_bessel_func.tcc>
1101 #include <tr1/poly_hermite.tcc>
1102 #include <tr1/poly_laguerre.tcc>
1103 #include <tr1/riemann_zeta.tcc>
1104
1105 namespace std _GLIBCXX_VISIBILITY(default)
1106 {
1107 namespace tr1
1108 {
1109 _GLIBCXX_BEGIN_NAMESPACE_VERSION
1110
1111   /**
1112    * @defgroup tr1_math_spec_func Mathematical Special Functions
1113    * @ingroup numerics
1114    *
1115    * A collection of advanced mathematical special functions.
1116    * @{
1117    */
1118
1119   inline float
1120   assoc_laguerref(unsigned int __n, unsigned int __m, float __x)
1121   { return __detail::__assoc_laguerre<float>(__n, __m, __x); }
1122
1123   inline long double
1124   assoc_laguerrel(unsigned int __n, unsigned int __m, long double __x)
1125   {
1126     return __detail::__assoc_laguerre<long double>(__n, __m, __x);
1127   }
1128
1129   ///  5.2.1.1  Associated Laguerre polynomials.
1130   template<typename _Tp>
1131     inline typename __gnu_cxx::__promote<_Tp>::__type
1132     assoc_laguerre(unsigned int __n, unsigned int __m, _Tp __x)
1133     {
1134       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1135       return __detail::__assoc_laguerre<__type>(__n, __m, __x);
1136     }
1137
1138   inline float
1139   assoc_legendref(unsigned int __l, unsigned int __m, float __x)
1140   { return __detail::__assoc_legendre_p<float>(__l, __m, __x); }
1141
1142   inline long double
1143   assoc_legendrel(unsigned int __l, unsigned int __m, long double __x)
1144   { return __detail::__assoc_legendre_p<long double>(__l, __m, __x); }
1145
1146   ///  5.2.1.2  Associated Legendre functions.
1147   template<typename _Tp>
1148     inline typename __gnu_cxx::__promote<_Tp>::__type
1149     assoc_legendre(unsigned int __l, unsigned int __m, _Tp __x)
1150     {
1151       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1152       return __detail::__assoc_legendre_p<__type>(__l, __m, __x);
1153     }
1154
1155   inline float
1156   betaf(float __x, float __y)
1157   { return __detail::__beta<float>(__x, __y); }
1158
1159   inline long double
1160   betal(long double __x, long double __y)
1161   { return __detail::__beta<long double>(__x, __y); }
1162
1163   ///  5.2.1.3  Beta functions.
1164   template<typename _Tpx, typename _Tpy>
1165     inline typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type
1166     beta(_Tpx __x, _Tpy __y)
1167     {
1168       typedef typename __gnu_cxx::__promote_2<_Tpx, _Tpy>::__type __type;
1169       return __detail::__beta<__type>(__x, __y);
1170     }
1171
1172   inline float
1173   comp_ellint_1f(float __k)
1174   { return __detail::__comp_ellint_1<float>(__k); }
1175
1176   inline long double
1177   comp_ellint_1l(long double __k)
1178   { return __detail::__comp_ellint_1<long double>(__k); }
1179
1180   ///  5.2.1.4  Complete elliptic integrals of the first kind.
1181   template<typename _Tp>
1182     inline typename __gnu_cxx::__promote<_Tp>::__type
1183     comp_ellint_1(_Tp __k)
1184     {
1185       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1186       return __detail::__comp_ellint_1<__type>(__k);
1187     }
1188
1189   inline float
1190   comp_ellint_2f(float __k)
1191   { return __detail::__comp_ellint_2<float>(__k); }
1192
1193   inline long double
1194   comp_ellint_2l(long double __k)
1195   { return __detail::__comp_ellint_2<long double>(__k); }
1196
1197   ///  5.2.1.5  Complete elliptic integrals of the second kind.
1198   template<typename _Tp>
1199     inline typename __gnu_cxx::__promote<_Tp>::__type
1200     comp_ellint_2(_Tp __k)
1201     {
1202       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1203       return __detail::__comp_ellint_2<__type>(__k);
1204     }
1205
1206   inline float
1207   comp_ellint_3f(float __k, float __nu)
1208   { return __detail::__comp_ellint_3<float>(__k, __nu); }
1209
1210   inline long double
1211   comp_ellint_3l(long double __k, long double __nu)
1212   { return __detail::__comp_ellint_3<long double>(__k, __nu); }
1213
1214   ///  5.2.1.6  Complete elliptic integrals of the third kind.
1215   template<typename _Tp, typename _Tpn>
1216     inline typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type
1217     comp_ellint_3(_Tp __k, _Tpn __nu)
1218     {
1219       typedef typename __gnu_cxx::__promote_2<_Tp, _Tpn>::__type __type;
1220       return __detail::__comp_ellint_3<__type>(__k, __nu);
1221     }
1222
1223   inline float
1224   conf_hypergf(float __a, float __c, float __x)
1225   { return __detail::__conf_hyperg<float>(__a, __c, __x); }
1226
1227   inline long double
1228   conf_hypergl(long double __a, long double __c, long double __x)
1229   { return __detail::__conf_hyperg<long double>(__a, __c, __x); }
1230
1231   ///  5.2.1.7  Confluent hypergeometric functions.
1232   template<typename _Tpa, typename _Tpc, typename _Tp>
1233     inline typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type
1234     conf_hyperg(_Tpa __a, _Tpc __c, _Tp __x)
1235     {
1236       typedef typename __gnu_cxx::__promote_3<_Tpa, _Tpc, _Tp>::__type __type;
1237       return __detail::__conf_hyperg<__type>(__a, __c, __x);
1238     }
1239
1240   inline float
1241   cyl_bessel_if(float __nu, float __x)
1242   { return __detail::__cyl_bessel_i<float>(__nu, __x); }
1243
1244   inline long double
1245   cyl_bessel_il(long double __nu, long double __x)
1246   { return __detail::__cyl_bessel_i<long double>(__nu, __x); }
1247
1248   ///  5.2.1.8  Regular modified cylindrical Bessel functions.
1249   template<typename _Tpnu, typename _Tp>
1250     inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
1251     cyl_bessel_i(_Tpnu __nu, _Tp __x)
1252     {
1253       typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
1254       return __detail::__cyl_bessel_i<__type>(__nu, __x);
1255     }
1256
1257   inline float
1258   cyl_bessel_jf(float __nu, float __x)
1259   { return __detail::__cyl_bessel_j<float>(__nu, __x); }
1260
1261   inline long double
1262   cyl_bessel_jl(long double __nu, long double __x)
1263   { return __detail::__cyl_bessel_j<long double>(__nu, __x); }
1264
1265   ///  5.2.1.9  Cylindrical Bessel functions (of the first kind).
1266   template<typename _Tpnu, typename _Tp>
1267     inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
1268     cyl_bessel_j(_Tpnu __nu, _Tp __x)
1269     {
1270       typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
1271       return __detail::__cyl_bessel_j<__type>(__nu, __x);
1272     }
1273
1274   inline float
1275   cyl_bessel_kf(float __nu, float __x)
1276   { return __detail::__cyl_bessel_k<float>(__nu, __x); }
1277
1278   inline long double
1279   cyl_bessel_kl(long double __nu, long double __x)
1280   { return __detail::__cyl_bessel_k<long double>(__nu, __x); }
1281
1282   ///  5.2.1.10  Irregular modified cylindrical Bessel functions.
1283   template<typename _Tpnu, typename _Tp>
1284     inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
1285     cyl_bessel_k(_Tpnu __nu, _Tp __x)
1286     {
1287       typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
1288       return __detail::__cyl_bessel_k<__type>(__nu, __x);
1289     }
1290
1291   inline float
1292   cyl_neumannf(float __nu, float __x)
1293   { return __detail::__cyl_neumann_n<float>(__nu, __x); }
1294
1295   inline long double
1296   cyl_neumannl(long double __nu, long double __x)
1297   { return __detail::__cyl_neumann_n<long double>(__nu, __x); }
1298
1299   ///  5.2.1.11  Cylindrical Neumann functions.
1300   template<typename _Tpnu, typename _Tp>
1301     inline typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type
1302     cyl_neumann(_Tpnu __nu, _Tp __x)
1303     {
1304       typedef typename __gnu_cxx::__promote_2<_Tpnu, _Tp>::__type __type;
1305       return __detail::__cyl_neumann_n<__type>(__nu, __x);
1306     }
1307
1308   inline float
1309   ellint_1f(float __k, float __phi)
1310   { return __detail::__ellint_1<float>(__k, __phi); }
1311
1312   inline long double
1313   ellint_1l(long double __k, long double __phi)
1314   { return __detail::__ellint_1<long double>(__k, __phi); }
1315
1316   ///  5.2.1.12  Incomplete elliptic integrals of the first kind.
1317   template<typename _Tp, typename _Tpp>
1318     inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
1319     ellint_1(_Tp __k, _Tpp __phi)
1320     {
1321       typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
1322       return __detail::__ellint_1<__type>(__k, __phi);
1323     }
1324
1325   inline float
1326   ellint_2f(float __k, float __phi)
1327   { return __detail::__ellint_2<float>(__k, __phi); }
1328
1329   inline long double
1330   ellint_2l(long double __k, long double __phi)
1331   { return __detail::__ellint_2<long double>(__k, __phi); }
1332
1333   ///  5.2.1.13  Incomplete elliptic integrals of the second kind.
1334   template<typename _Tp, typename _Tpp>
1335     inline typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type
1336     ellint_2(_Tp __k, _Tpp __phi)
1337     {
1338       typedef typename __gnu_cxx::__promote_2<_Tp, _Tpp>::__type __type;
1339       return __detail::__ellint_2<__type>(__k, __phi);
1340     }
1341
1342   inline float
1343   ellint_3f(float __k, float __nu, float __phi)
1344   { return __detail::__ellint_3<float>(__k, __nu, __phi); }
1345
1346   inline long double
1347   ellint_3l(long double __k, long double __nu, long double __phi)
1348   { return __detail::__ellint_3<long double>(__k, __nu, __phi); }
1349
1350   ///  5.2.1.14  Incomplete elliptic integrals of the third kind.
1351   template<typename _Tp, typename _Tpn, typename _Tpp>
1352     inline typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type
1353     ellint_3(_Tp __k, _Tpn __nu, _Tpp __phi)
1354     {
1355       typedef typename __gnu_cxx::__promote_3<_Tp, _Tpn, _Tpp>::__type __type;
1356       return __detail::__ellint_3<__type>(__k, __nu, __phi);
1357     }
1358
1359   inline float
1360   expintf(float __x)
1361   { return __detail::__expint<float>(__x); }
1362
1363   inline long double
1364   expintl(long double __x)
1365   { return __detail::__expint<long double>(__x); }
1366
1367   ///  5.2.1.15  Exponential integrals.
1368   template<typename _Tp>
1369     inline typename __gnu_cxx::__promote<_Tp>::__type
1370     expint(_Tp __x)
1371     {
1372       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1373       return __detail::__expint<__type>(__x);
1374     }
1375
1376   inline float
1377   hermitef(unsigned int __n, float __x)
1378   { return __detail::__poly_hermite<float>(__n, __x); }
1379
1380   inline long double
1381   hermitel(unsigned int __n, long double __x)
1382   { return __detail::__poly_hermite<long double>(__n, __x); }
1383
1384   ///  5.2.1.16  Hermite polynomials.
1385   template<typename _Tp>
1386     inline typename __gnu_cxx::__promote<_Tp>::__type
1387     hermite(unsigned int __n, _Tp __x)
1388     {
1389       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1390       return __detail::__poly_hermite<__type>(__n, __x);
1391     }
1392
1393   inline float
1394   hypergf(float __a, float __b, float __c, float __x)
1395   { return __detail::__hyperg<float>(__a, __b, __c, __x); }
1396
1397   inline long double
1398   hypergl(long double __a, long double __b, long double __c, long double __x)
1399   { return __detail::__hyperg<long double>(__a, __b, __c, __x); }
1400
1401   ///  5.2.1.17  Hypergeometric functions.
1402   template<typename _Tpa, typename _Tpb, typename _Tpc, typename _Tp>
1403     inline typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type
1404     hyperg(_Tpa __a, _Tpb __b, _Tpc __c, _Tp __x)
1405     {
1406       typedef typename __gnu_cxx::__promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type __type;
1407       return __detail::__hyperg<__type>(__a, __b, __c, __x);
1408     }
1409
1410   inline float
1411   laguerref(unsigned int __n, float __x)
1412   { return __detail::__laguerre<float>(__n, __x); }
1413
1414   inline long double
1415   laguerrel(unsigned int __n, long double __x)
1416   { return __detail::__laguerre<long double>(__n, __x); }
1417
1418   ///  5.2.1.18  Laguerre polynomials.
1419   template<typename _Tp>
1420     inline typename __gnu_cxx::__promote<_Tp>::__type
1421     laguerre(unsigned int __n, _Tp __x)
1422     {
1423       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1424       return __detail::__laguerre<__type>(__n, __x);
1425     }
1426
1427   inline float
1428   legendref(unsigned int __n, float __x)
1429   { return __detail::__poly_legendre_p<float>(__n, __x); }
1430
1431   inline long double
1432   legendrel(unsigned int __n, long double __x)
1433   { return __detail::__poly_legendre_p<long double>(__n, __x); }
1434
1435   ///  5.2.1.19  Legendre polynomials.
1436   template<typename _Tp>
1437     inline typename __gnu_cxx::__promote<_Tp>::__type
1438     legendre(unsigned int __n, _Tp __x)
1439     {
1440       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1441       return __detail::__poly_legendre_p<__type>(__n, __x);
1442     }
1443
1444   inline float
1445   riemann_zetaf(float __x)
1446   { return __detail::__riemann_zeta<float>(__x); }
1447
1448   inline long double
1449   riemann_zetal(long double __x)
1450   { return __detail::__riemann_zeta<long double>(__x); }
1451
1452   ///  5.2.1.20  Riemann zeta function.
1453   template<typename _Tp>
1454     inline typename __gnu_cxx::__promote<_Tp>::__type
1455     riemann_zeta(_Tp __x)
1456     {
1457       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1458       return __detail::__riemann_zeta<__type>(__x);
1459     }
1460
1461   inline float
1462   sph_besself(unsigned int __n, float __x)
1463   { return __detail::__sph_bessel<float>(__n, __x); }
1464
1465   inline long double
1466   sph_bessell(unsigned int __n, long double __x)
1467   { return __detail::__sph_bessel<long double>(__n, __x); }
1468
1469   ///  5.2.1.21  Spherical Bessel functions.
1470   template<typename _Tp>
1471     inline typename __gnu_cxx::__promote<_Tp>::__type
1472     sph_bessel(unsigned int __n, _Tp __x)
1473     {
1474       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1475       return __detail::__sph_bessel<__type>(__n, __x);
1476     }
1477
1478   inline float
1479   sph_legendref(unsigned int __l, unsigned int __m, float __theta)
1480   { return __detail::__sph_legendre<float>(__l, __m, __theta); }
1481
1482   inline long double
1483   sph_legendrel(unsigned int __l, unsigned int __m, long double __theta)
1484   { return __detail::__sph_legendre<long double>(__l, __m, __theta); }
1485
1486   ///  5.2.1.22  Spherical associated Legendre functions.
1487   template<typename _Tp>
1488     inline typename __gnu_cxx::__promote<_Tp>::__type
1489     sph_legendre(unsigned int __l, unsigned int __m, _Tp __theta)
1490     {
1491       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1492       return __detail::__sph_legendre<__type>(__l, __m, __theta);
1493     }
1494
1495   inline float
1496   sph_neumannf(unsigned int __n, float __x)
1497   { return __detail::__sph_neumann<float>(__n, __x); }
1498
1499   inline long double
1500   sph_neumannl(unsigned int __n, long double __x)
1501   { return __detail::__sph_neumann<long double>(__n, __x); }
1502
1503   ///  5.2.1.23  Spherical Neumann functions.
1504   template<typename _Tp>
1505     inline typename __gnu_cxx::__promote<_Tp>::__type
1506     sph_neumann(unsigned int __n, _Tp __x)
1507     {
1508       typedef typename __gnu_cxx::__promote<_Tp>::__type __type;
1509       return __detail::__sph_neumann<__type>(__n, __x);
1510     }
1511
1512   /* @} */ // tr1_math_spec_func
1513 _GLIBCXX_END_NAMESPACE_VERSION
1514 }
1515 }
1516
1517 #endif // _GLIBCXX_TR1_CMATH