Stan Math Library  2.20.0
reverse mode automatic differentiation
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 
5 #include <boost/math/tools/promotion.hpp>
6 
7 namespace stan {
8 namespace math {
9 
50 template <typename T_a, typename T_b>
51 inline typename boost::math::tools::promote_args<T_a, T_b>::type multiply_log(
52  const T_a a, const T_b b) {
53  using std::log;
54  if (b == 0.0 && a == 0.0)
55  return 0.0;
56  return a * log(b);
57 }
58 
59 } // namespace math
60 } // namespace stan
61 
62 #endif
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:12
fvar< T > multiply_log(const fvar< T > &x1, const fvar< T > &x2)

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