1 // Special functions -*- C++ -*-
3 // Copyright (C) 2006, 2007, 2008
4 // Free Software Foundation, Inc.
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 2, or (at your option)
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // You should have received a copy of the GNU General Public License along
18 // with this library; see the file COPYING. If not, write to the Free
19 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
22 // As a special exception, you may use this file as part of a free software
23 // library without restriction. Specifically, if other files instantiate
24 // templates or use macros or inline functions from this file, or you compile
25 // this file and link it with other files to produce an executable, this
26 // file does not by itself cause the resulting executable to be covered by
27 // the GNU General Public License. This exception does not however
28 // invalidate any other reasons why the executable file might be covered by
29 // the GNU General Public License.
31 /** @file tr1/hypergeometric.tcc
32 * This is an internal header file, included by other library headers.
33 * You should not attempt to use it directly.
37 // ISO C++ 14882 TR1: 5.2 Special functions
40 // Written by Edward Smith-Rowland based:
41 // (1) Handbook of Mathematical Functions,
42 // ed. Milton Abramowitz and Irene A. Stegun,
43 // Dover Publications,
44 // Section 6, pp. 555-566
45 // (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
47 #ifndef _GLIBCXX_TR1_HYPERGEOMETRIC_TCC
48 #define _GLIBCXX_TR1_HYPERGEOMETRIC_TCC 1
55 // [5.2] Special functions
57 // Implementation-space details.
62 * @brief This routine returns the confluent hypergeometric function
63 * by series expansion.
66 * _1F_1(a;c;x) = \frac{\Gamma(c)}{\Gamma(a)}
68 * \frac{\Gamma(a+n)}{\Gamma(c+n)}
72 * If a and b are integers and a < 0 and either b > 0 or b < a then the
73 * series is a polynomial with a finite number of terms. If b is an integer
74 * and b <= 0 the confluent hypergeometric function is undefined.
76 * @param __a The "numerator" parameter.
77 * @param __c The "denominator" parameter.
78 * @param __x The argument of the confluent hypergeometric function.
79 * @return The confluent hypergeometric function.
81 template<typename _Tp>
83 __conf_hyperg_series(const _Tp __a, const _Tp __c, const _Tp __x)
85 const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
89 const unsigned int __max_iter = 100000;
91 for (__i = 0; __i < __max_iter; ++__i)
93 __term *= (__a + _Tp(__i)) * __x
94 / ((__c + _Tp(__i)) * _Tp(1 + __i));
95 if (std::abs(__term) < __eps)
101 if (__i == __max_iter)
102 std::__throw_runtime_error(__N("Series failed to converge "
103 "in __conf_hyperg_series."));
110 * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$
111 * by an iterative procedure described in
112 * Luke, Algorithms for the Computation of Mathematical Functions.
114 * Like the case of the 2F1 rational approximations, these are
115 * probably guaranteed to converge for x < 0, barring gross
116 * numerical instability in the pre-asymptotic regime.
118 template<typename _Tp>
120 __conf_hyperg_luke(const _Tp __a, const _Tp __c, const _Tp __xin)
122 const _Tp __big = std::pow(std::numeric_limits<_Tp>::max(), _Tp(0.16L));
123 const int __nmax = 20000;
124 const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
125 const _Tp __x = -__xin;
126 const _Tp __x3 = __x * __x * __x;
127 const _Tp __t0 = __a / __c;
128 const _Tp __t1 = (__a + _Tp(1)) / (_Tp(2) * __c);
129 const _Tp __t2 = (__a + _Tp(2)) / (_Tp(2) * (__c + _Tp(1)));
134 _Tp __Bnm2 = _Tp(1) + __t1 * __x;
135 _Tp __Bnm1 = _Tp(1) + __t2 * __x * (_Tp(1) + __t1 / _Tp(3) * __x);
138 _Tp __Anm2 = __Bnm2 - __t0 * __x;
139 _Tp __Anm1 = __Bnm1 - __t0 * (_Tp(1) + __t2 * __x) * __x
140 + __t0 * __t1 * (__c / (__c + _Tp(1))) * __x * __x;
145 _Tp __npam1 = _Tp(__n - 1) + __a;
146 _Tp __npcm1 = _Tp(__n - 1) + __c;
147 _Tp __npam2 = _Tp(__n - 2) + __a;
148 _Tp __npcm2 = _Tp(__n - 2) + __c;
149 _Tp __tnm1 = _Tp(2 * __n - 1);
150 _Tp __tnm3 = _Tp(2 * __n - 3);
151 _Tp __tnm5 = _Tp(2 * __n - 5);
152 _Tp __F1 = (_Tp(__n - 2) - __a) / (_Tp(2) * __tnm3 * __npcm1);
153 _Tp __F2 = (_Tp(__n) + __a) * __npam1
154 / (_Tp(4) * __tnm1 * __tnm3 * __npcm2 * __npcm1);
155 _Tp __F3 = -__npam2 * __npam1 * (_Tp(__n - 2) - __a)
156 / (_Tp(8) * __tnm3 * __tnm3 * __tnm5
157 * (_Tp(__n - 3) + __c) * __npcm2 * __npcm1);
158 _Tp __E = -__npam1 * (_Tp(__n - 1) - __c)
159 / (_Tp(2) * __tnm3 * __npcm2 * __npcm1);
161 _Tp __An = (_Tp(1) + __F1 * __x) * __Anm1
162 + (__E + __F2 * __x) * __x * __Anm2 + __F3 * __x3 * __Anm3;
163 _Tp __Bn = (_Tp(1) + __F1 * __x) * __Bnm1
164 + (__E + __F2 * __x) * __x * __Bnm2 + __F3 * __x3 * __Bnm3;
165 _Tp __r = __An / __Bn;
167 __prec = std::abs((__F - __r) / __F);
170 if (__prec < __eps || __n > __nmax)
173 if (std::abs(__An) > __big || std::abs(__Bn) > __big)
184 else if (std::abs(__An) < _Tp(1) / __big
185 || std::abs(__Bn) < _Tp(1) / __big)
207 std::__throw_runtime_error(__N("Iteration failed to converge "
208 "in __conf_hyperg_luke."));
215 * @brief Return the confluent hypogeometric function
216 * @f$ _1F_1(a;c;x) @f$.
218 * @todo Handle b == nonpositive integer blowup - return NaN.
220 * @param __a The "numerator" parameter.
221 * @param __c The "denominator" parameter.
222 * @param __x The argument of the confluent hypergeometric function.
223 * @return The confluent hypergeometric function.
225 template<typename _Tp>
227 __conf_hyperg(const _Tp __a, const _Tp __c, const _Tp __x)
229 #if _GLIBCXX_USE_C99_MATH_TR1
230 const _Tp __c_nint = std::tr1::nearbyint(__c);
232 const _Tp __c_nint = static_cast<int>(__c + _Tp(0.5L));
234 if (__isnan(__a) || __isnan(__c) || __isnan(__x))
235 return std::numeric_limits<_Tp>::quiet_NaN();
236 else if (__c_nint == __c && __c_nint <= 0)
237 return std::numeric_limits<_Tp>::infinity();
238 else if (__a == _Tp(0))
241 return std::exp(__x);
242 else if (__x < _Tp(0))
243 return __conf_hyperg_luke(__a, __c, __x);
245 return __conf_hyperg_series(__a, __c, __x);
250 * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$
251 * by series expansion.
253 * The hypogeometric function is defined by
255 * _2F_1(a,b;c;x) = \frac{\Gamma(c)}{\Gamma(a)\Gamma(b)}
256 * \sum_{n=0}^{\infty}
257 * \frac{\Gamma(a+n)\Gamma(b+n)}{\Gamma(c+n)}
261 * This works and it's pretty fast.
263 * @param __a The first "numerator" parameter.
264 * @param __a The second "numerator" parameter.
265 * @param __c The "denominator" parameter.
266 * @param __x The argument of the confluent hypergeometric function.
267 * @return The confluent hypergeometric function.
269 template<typename _Tp>
271 __hyperg_series(const _Tp __a, const _Tp __b,
272 const _Tp __c, const _Tp __x)
274 const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
278 const unsigned int __max_iter = 100000;
280 for (__i = 0; __i < __max_iter; ++__i)
282 __term *= (__a + _Tp(__i)) * (__b + _Tp(__i)) * __x
283 / ((__c + _Tp(__i)) * _Tp(1 + __i));
284 if (std::abs(__term) < __eps)
290 if (__i == __max_iter)
291 std::__throw_runtime_error(__N("Series failed to converge "
292 "in __hyperg_series."));
299 * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$
300 * by an iterative procedure described in
301 * Luke, Algorithms for the Computation of Mathematical Functions.
303 template<typename _Tp>
305 __hyperg_luke(const _Tp __a, const _Tp __b, const _Tp __c,
308 const _Tp __big = std::pow(std::numeric_limits<_Tp>::max(), _Tp(0.16L));
309 const int __nmax = 20000;
310 const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
311 const _Tp __x = -__xin;
312 const _Tp __x3 = __x * __x * __x;
313 const _Tp __t0 = __a * __b / __c;
314 const _Tp __t1 = (__a + _Tp(1)) * (__b + _Tp(1)) / (_Tp(2) * __c);
315 const _Tp __t2 = (__a + _Tp(2)) * (__b + _Tp(2))
316 / (_Tp(2) * (__c + _Tp(1)));
321 _Tp __Bnm2 = _Tp(1) + __t1 * __x;
322 _Tp __Bnm1 = _Tp(1) + __t2 * __x * (_Tp(1) + __t1 / _Tp(3) * __x);
325 _Tp __Anm2 = __Bnm2 - __t0 * __x;
326 _Tp __Anm1 = __Bnm1 - __t0 * (_Tp(1) + __t2 * __x) * __x
327 + __t0 * __t1 * (__c / (__c + _Tp(1))) * __x * __x;
332 const _Tp __npam1 = _Tp(__n - 1) + __a;
333 const _Tp __npbm1 = _Tp(__n - 1) + __b;
334 const _Tp __npcm1 = _Tp(__n - 1) + __c;
335 const _Tp __npam2 = _Tp(__n - 2) + __a;
336 const _Tp __npbm2 = _Tp(__n - 2) + __b;
337 const _Tp __npcm2 = _Tp(__n - 2) + __c;
338 const _Tp __tnm1 = _Tp(2 * __n - 1);
339 const _Tp __tnm3 = _Tp(2 * __n - 3);
340 const _Tp __tnm5 = _Tp(2 * __n - 5);
341 const _Tp __n2 = __n * __n;
342 const _Tp __F1 = (_Tp(3) * __n2 + (__a + __b - _Tp(6)) * __n
343 + _Tp(2) - __a * __b - _Tp(2) * (__a + __b))
344 / (_Tp(2) * __tnm3 * __npcm1);
345 const _Tp __F2 = -(_Tp(3) * __n2 - (__a + __b + _Tp(6)) * __n
346 + _Tp(2) - __a * __b) * __npam1 * __npbm1
347 / (_Tp(4) * __tnm1 * __tnm3 * __npcm2 * __npcm1);
348 const _Tp __F3 = (__npam2 * __npam1 * __npbm2 * __npbm1
349 * (_Tp(__n - 2) - __a) * (_Tp(__n - 2) - __b))
350 / (_Tp(8) * __tnm3 * __tnm3 * __tnm5
351 * (_Tp(__n - 3) + __c) * __npcm2 * __npcm1);
352 const _Tp __E = -__npam1 * __npbm1 * (_Tp(__n - 1) - __c)
353 / (_Tp(2) * __tnm3 * __npcm2 * __npcm1);
355 _Tp __An = (_Tp(1) + __F1 * __x) * __Anm1
356 + (__E + __F2 * __x) * __x * __Anm2 + __F3 * __x3 * __Anm3;
357 _Tp __Bn = (_Tp(1) + __F1 * __x) * __Bnm1
358 + (__E + __F2 * __x) * __x * __Bnm2 + __F3 * __x3 * __Bnm3;
359 const _Tp __r = __An / __Bn;
361 const _Tp __prec = std::abs((__F - __r) / __F);
364 if (__prec < __eps || __n > __nmax)
367 if (std::abs(__An) > __big || std::abs(__Bn) > __big)
378 else if (std::abs(__An) < _Tp(1) / __big
379 || std::abs(__Bn) < _Tp(1) / __big)
401 std::__throw_runtime_error(__N("Iteration failed to converge "
402 "in __hyperg_luke."));
409 * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$ by the reflection
410 * formulae in Abramowitz & Stegun formula 15.3.6 for d = c - a - b not integral
411 * and formula 15.3.11 for d = c - a - b integral.
412 * This assumes a, b, c != negative integer.
414 * The hypogeometric function is defined by
416 * _2F_1(a,b;c;x) = \frac{\Gamma(c)}{\Gamma(a)\Gamma(b)}
417 * \sum_{n=0}^{\infty}
418 * \frac{\Gamma(a+n)\Gamma(b+n)}{\Gamma(c+n)}
422 * The reflection formula for nonintegral @f$ d = c - a - b @f$ is:
424 * _2F_1(a,b;c;x) = \frac{\Gamma(c)\Gamma(d)}{\Gamma(c-a)\Gamma(c-b)}
426 * + \frac{\Gamma(c)\Gamma(-d)}{\Gamma(a)\Gamma(b)}
427 * _2F_1(c-a,c-b;1+d;1-x)
430 * The reflection formula for integral @f$ m = c - a - b @f$ is:
432 * _2F_1(a,b;a+b+m;x) = \frac{\Gamma(m)\Gamma(a+b+m)}{\Gamma(a+m)\Gamma(b+m)}
433 * \sum_{k=0}^{m-1} \frac{(m+a)_k(m+b)_k}{k!(1-m)_k}
437 template<typename _Tp>
439 __hyperg_reflect(const _Tp __a, const _Tp __b, const _Tp __c,
442 const _Tp __d = __c - __a - __b;
443 const int __intd = std::floor(__d + _Tp(0.5L));
444 const _Tp __eps = std::numeric_limits<_Tp>::epsilon();
445 const _Tp __toler = _Tp(1000) * __eps;
446 const _Tp __log_max = std::log(std::numeric_limits<_Tp>::max());
447 const bool __d_integer = (std::abs(__d - __intd) < __toler);
451 const _Tp __ln_omx = std::log(_Tp(1) - __x);
452 const _Tp __ad = std::abs(__d);
467 const _Tp __lng_c = __log_gamma(__c);
472 // d = c - a - b = 0.
479 _Tp __lng_ad, __lng_ad1, __lng_bd1;
482 __lng_ad = __log_gamma(__ad);
483 __lng_ad1 = __log_gamma(__a + __d1);
484 __lng_bd1 = __log_gamma(__b + __d1);
493 /* Gamma functions in the denominator are ok.
494 * Proceed with evaluation.
498 _Tp __ln_pre1 = __lng_ad + __lng_c + __d2 * __ln_omx
499 - __lng_ad1 - __lng_bd1;
503 for (int __i = 1; __i < __ad; ++__i)
505 const int __j = __i - 1;
506 __term *= (__a + __d2 + __j) * (__b + __d2 + __j)
507 / (_Tp(1) + __d2 + __j) / __i * (_Tp(1) - __x);
511 if (__ln_pre1 > __log_max)
512 std::__throw_runtime_error(__N("Overflow of gamma functions "
513 "in __hyperg_luke."));
515 __F1 = std::exp(__ln_pre1) * __sum1;
519 // Gamma functions in the denominator were not ok.
520 // So the F1 term is zero.
523 } // end F1 evaluation
527 _Tp __lng_ad2, __lng_bd2;
530 __lng_ad2 = __log_gamma(__a + __d2);
531 __lng_bd2 = __log_gamma(__b + __d2);
540 // Gamma functions in the denominator are ok.
541 // Proceed with evaluation.
542 const int __maxiter = 2000;
543 const _Tp __psi_1 = -__numeric_constants<_Tp>::__gamma_e();
544 const _Tp __psi_1pd = __psi(_Tp(1) + __ad);
545 const _Tp __psi_apd1 = __psi(__a + __d1);
546 const _Tp __psi_bpd1 = __psi(__b + __d1);
548 _Tp __psi_term = __psi_1 + __psi_1pd - __psi_apd1
549 - __psi_bpd1 - __ln_omx;
551 _Tp __sum2 = __psi_term;
552 _Tp __ln_pre2 = __lng_c + __d1 * __ln_omx
553 - __lng_ad2 - __lng_bd2;
557 for (__j = 1; __j < __maxiter; ++__j)
559 // Values for psi functions use recurrence; Abramowitz & Stegun 6.3.5
560 const _Tp __term1 = _Tp(1) / _Tp(__j)
561 + _Tp(1) / (__ad + __j);
562 const _Tp __term2 = _Tp(1) / (__a + __d1 + _Tp(__j - 1))
563 + _Tp(1) / (__b + __d1 + _Tp(__j - 1));
564 __psi_term += __term1 - __term2;
565 __fact *= (__a + __d1 + _Tp(__j - 1))
566 * (__b + __d1 + _Tp(__j - 1))
567 / ((__ad + __j) * __j) * (_Tp(1) - __x);
568 const _Tp __delta = __fact * __psi_term;
570 if (std::abs(__delta) < __eps * std::abs(__sum2))
573 if (__j == __maxiter)
574 std::__throw_runtime_error(__N("Sum F2 failed to converge "
575 "in __hyperg_reflect"));
577 if (__sum2 == _Tp(0))
580 __F2 = std::exp(__ln_pre2) * __sum2;
584 // Gamma functions in the denominator not ok.
585 // So the F2 term is zero.
587 } // end F2 evaluation
589 const _Tp __sgn_2 = (__intd % 2 == 1 ? -_Tp(1) : _Tp(1));
590 const _Tp __F = __F1 + __sgn_2 * __F2;
596 // d = c - a - b not an integer.
598 // These gamma functions appear in the denominator, so we
599 // catch their harmless domain errors and set the terms to zero.
601 _Tp __sgn_g1ca = _Tp(0), __ln_g1ca = _Tp(0);
602 _Tp __sgn_g1cb = _Tp(0), __ln_g1cb = _Tp(0);
605 __sgn_g1ca = __log_gamma_sign(__c - __a);
606 __ln_g1ca = __log_gamma(__c - __a);
607 __sgn_g1cb = __log_gamma_sign(__c - __b);
608 __ln_g1cb = __log_gamma(__c - __b);
616 _Tp __sgn_g2a = _Tp(0), __ln_g2a = _Tp(0);
617 _Tp __sgn_g2b = _Tp(0), __ln_g2b = _Tp(0);
620 __sgn_g2a = __log_gamma_sign(__a);
621 __ln_g2a = __log_gamma(__a);
622 __sgn_g2b = __log_gamma_sign(__b);
623 __ln_g2b = __log_gamma(__b);
630 const _Tp __sgn_gc = __log_gamma_sign(__c);
631 const _Tp __ln_gc = __log_gamma(__c);
632 const _Tp __sgn_gd = __log_gamma_sign(__d);
633 const _Tp __ln_gd = __log_gamma(__d);
634 const _Tp __sgn_gmd = __log_gamma_sign(-__d);
635 const _Tp __ln_gmd = __log_gamma(-__d);
637 const _Tp __sgn1 = __sgn_gc * __sgn_gd * __sgn_g1ca * __sgn_g1cb;
638 const _Tp __sgn2 = __sgn_gc * __sgn_gmd * __sgn_g2a * __sgn_g2b;
643 _Tp __ln_pre1 = __ln_gc + __ln_gd - __ln_g1ca - __ln_g1cb;
644 _Tp __ln_pre2 = __ln_gc + __ln_gmd - __ln_g2a - __ln_g2b
645 + __d * std::log(_Tp(1) - __x);
646 if (__ln_pre1 < __log_max && __ln_pre2 < __log_max)
648 __pre1 = std::exp(__ln_pre1);
649 __pre2 = std::exp(__ln_pre2);
655 std::__throw_runtime_error(__N("Overflow of gamma functions "
656 "in __hyperg_reflect"));
659 else if (__ok1 && !__ok2)
661 _Tp __ln_pre1 = __ln_gc + __ln_gd - __ln_g1ca - __ln_g1cb;
662 if (__ln_pre1 < __log_max)
664 __pre1 = std::exp(__ln_pre1);
670 std::__throw_runtime_error(__N("Overflow of gamma functions "
671 "in __hyperg_reflect"));
674 else if (!__ok1 && __ok2)
676 _Tp __ln_pre2 = __ln_gc + __ln_gmd - __ln_g2a - __ln_g2b
677 + __d * std::log(_Tp(1) - __x);
678 if (__ln_pre2 < __log_max)
681 __pre2 = std::exp(__ln_pre2);
686 std::__throw_runtime_error(__N("Overflow of gamma functions "
687 "in __hyperg_reflect"));
694 std::__throw_runtime_error(__N("Underflow of gamma functions "
695 "in __hyperg_reflect"));
698 const _Tp __F1 = __hyperg_series(__a, __b, _Tp(1) - __d,
700 const _Tp __F2 = __hyperg_series(__c - __a, __c - __b, _Tp(1) + __d,
703 const _Tp __F = __pre1 * __F1 + __pre2 * __F2;
711 * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$.
713 * The hypogeometric function is defined by
715 * _2F_1(a,b;c;x) = \frac{\Gamma(c)}{\Gamma(a)\Gamma(b)}
716 * \sum_{n=0}^{\infty}
717 * \frac{\Gamma(a+n)\Gamma(b+n)}{\Gamma(c+n)}
721 * @param __a The first "numerator" parameter.
722 * @param __a The second "numerator" parameter.
723 * @param __c The "denominator" parameter.
724 * @param __x The argument of the confluent hypergeometric function.
725 * @return The confluent hypergeometric function.
727 template<typename _Tp>
729 __hyperg(const _Tp __a, const _Tp __b, const _Tp __c, const _Tp __x)
731 #if _GLIBCXX_USE_C99_MATH_TR1
732 const _Tp __a_nint = std::tr1::nearbyint(__a);
733 const _Tp __b_nint = std::tr1::nearbyint(__b);
734 const _Tp __c_nint = std::tr1::nearbyint(__c);
736 const _Tp __a_nint = static_cast<int>(__a + _Tp(0.5L));
737 const _Tp __b_nint = static_cast<int>(__b + _Tp(0.5L));
738 const _Tp __c_nint = static_cast<int>(__c + _Tp(0.5L));
740 const _Tp __toler = _Tp(1000) * std::numeric_limits<_Tp>::epsilon();
741 if (std::abs(__x) >= _Tp(1))
742 std::__throw_domain_error(__N("Argument outside unit circle "
744 else if (__isnan(__a) || __isnan(__b)
745 || __isnan(__c) || __isnan(__x))
746 return std::numeric_limits<_Tp>::quiet_NaN();
747 else if (__c_nint == __c && __c_nint <= _Tp(0))
748 return std::numeric_limits<_Tp>::infinity();
749 else if (std::abs(__c - __b) < __toler || std::abs(__c - __a) < __toler)
750 return std::pow(_Tp(1) - __x, __c - __a - __b);
751 else if (__a >= _Tp(0) && __b >= _Tp(0) && __c >= _Tp(0)
752 && __x >= _Tp(0) && __x < _Tp(0.995L))
753 return __hyperg_series(__a, __b, __c, __x);
754 else if (std::abs(__a) < _Tp(10) && std::abs(__b) < _Tp(10))
756 // For integer a and b the hypergeometric function is a finite polynomial.
757 if (__a < _Tp(0) && std::abs(__a - __a_nint) < __toler)
758 return __hyperg_series(__a_nint, __b, __c, __x);
759 else if (__b < _Tp(0) && std::abs(__b - __b_nint) < __toler)
760 return __hyperg_series(__a, __b_nint, __c, __x);
761 else if (__x < -_Tp(0.25L))
762 return __hyperg_luke(__a, __b, __c, __x);
763 else if (__x < _Tp(0.5L))
764 return __hyperg_series(__a, __b, __c, __x);
766 if (std::abs(__c) > _Tp(10))
767 return __hyperg_series(__a, __b, __c, __x);
769 return __hyperg_reflect(__a, __b, __c, __x);
772 return __hyperg_luke(__a, __b, __c, __x);
775 } // namespace std::tr1::__detail
779 #endif // _GLIBCXX_TR1_HYPERGEOMETRIC_TCC