This is an internal header file, included by other library headers. Do not attempt to use it directly. {tr1/cmath}
namespace std _GLIBCXX_VISIBILITY |
( |
default |
| ) |
|
Return the beta function:
.
The beta function is defined by
- Parameters
-
__x | The first argument of the beta function. |
__y | The second argument of the beta function. |
- Returns
- The beta function.
Return the beta function
using the log gamma functions.
The beta function is defined by
- Parameters
-
__x | The first argument of the beta function. |
__y | The second argument of the beta function. |
- Returns
- The beta function.
Return the beta function
using the product form.
The beta function is defined by
- Parameters
-
__x | The first argument of the beta function. |
__y | The second argument of the beta function. |
- Returns
- The beta function.
Return the beta function
.
The beta function is defined by
- Parameters
-
__x | The first argument of the beta function. |
__y | The second argument of the beta function. |
- Returns
- The beta function.
58 _GLIBCXX_BEGIN_NAMESPACE_VERSION
72 template<
typename _Tp>
74 __beta_gamma(_Tp __x, _Tp __y)
78 #if _GLIBCXX_USE_C99_MATH_TR1
81 __bet = std::tr1::tgamma(__x)
82 / std::tr1::tgamma(__x + __y);
83 __bet *= std::tr1::tgamma(__y);
87 __bet = std::tr1::tgamma(__y)
88 / std::tr1::tgamma(__x + __y);
89 __bet *= std::tr1::tgamma(__x);
94 __bet = __gamma(__x) / __gamma(__x + __y);
95 __bet *= __gamma(__y);
99 __bet = __gamma(__y) / __gamma(__x + __y);
100 __bet *= __gamma(__x);
120 template<
typename _Tp>
122 __beta_lgamma(_Tp __x, _Tp __y)
124 #if _GLIBCXX_USE_C99_MATH_TR1
125 _Tp __bet = std::tr1::lgamma(__x)
126 + std::tr1::lgamma(__y)
127 - std::tr1::lgamma(__x + __y);
129 _Tp __bet = __log_gamma(__x)
131 - __log_gamma(__x + __y);
133 __bet = std::exp(__bet);
151 template<
typename _Tp>
153 __beta_product(_Tp __x, _Tp __y)
156 _Tp __bet = (__x + __y) / (__x * __y);
158 unsigned int __max_iter = 1000000;
159 for (
unsigned int __k = 1; __k < __max_iter; ++__k)
161 _Tp __term = (_Tp(1) + (__x + __y) / __k)
162 / ((_Tp(1) + __x / __k) * (_Tp(1) + __y / __k));
182 template<
typename _Tp>
184 __beta(_Tp __x, _Tp __y)
186 if (__isnan(__x) || __isnan(__y))
187 return std::numeric_limits<_Tp>::quiet_NaN();
189 return __beta_lgamma(__x, __y);
192 _GLIBCXX_END_NAMESPACE_VERSION