Stan Math Library  2.20.0
reverse mode automatic differentiation
lbeta.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_FUN_LBETA_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_LBETA_HPP
3 
5 #include <boost/math/tools/promotion.hpp>
7 
8 namespace stan {
9 namespace math {
10 
57 template <typename T1, typename T2>
58 inline typename boost::math::tools::promote_args<T1, T2>::type lbeta(
59  const T1 a, const T2 b) {
60  return lgamma(a) + lgamma(b) - lgamma(a + b);
61 }
62 
63 } // namespace math
64 } // namespace stan
65 
66 #endif
fvar< T > lgamma(const fvar< T > &x)
Return the natural logarithm of the gamma function applied to the specified argument.
Definition: lgamma.hpp:21
fvar< T > lbeta(const fvar< T > &x1, const fvar< T > &x2)
Definition: lbeta.hpp:14

     [ Stan Home Page ] © 2011–2018, Stan Development Team.