Stan Math Library  2.6.3
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
multiply_log.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_FUN_MULTIPLY_LOG_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_MULTIPLY_LOG_HPP
3 
4 #include <boost/math/tools/promotion.hpp>
5 
6 namespace stan {
7  namespace math {
8 
49  template <typename T_a, typename T_b>
50  inline typename boost::math::tools::promote_args<T_a, T_b>::type
51  multiply_log(const T_a a, const T_b b) {
52  using std::log;
53  if (b == 0.0 && a == 0.0)
54  return 0.0;
55  return a * log(b);
56  }
57 
58  }
59 }
60 
61 #endif
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:15
fvar< T > multiply_log(const fvar< T > &x1, const fvar< T > &x2)

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