1 #ifndef STAN_MATH_FWD_SCAL_FUN_MULTIPLY_LOG_HPP
2 #define STAN_MATH_FWD_SCAL_FUN_MULTIPLY_LOG_HPP
3 
4 #include <stan/math/fwd/core.hpp>
5 
6 #include <stan/math/prim/scal/fun/multiply_log.hpp>
7 
8 namespace stan {
9 namespace math {
10 
11 template <typename T>
multiply_log(const fvar<T> & x1,const fvar<T> & x2)12 inline fvar<T> multiply_log(const fvar<T>& x1, const fvar<T>& x2) {
13   using std::log;
14   return fvar<T>(multiply_log(x1.val_, x2.val_),
15                  x1.d_ * log(x2.val_) + x1.val_ * x2.d_ / x2.val_);
16 }
17 
18 template <typename T>
multiply_log(double x1,const fvar<T> & x2)19 inline fvar<T> multiply_log(double x1, const fvar<T>& x2) {
20   using std::log;
21   return fvar<T>(multiply_log(x1, x2.val_), x1 * x2.d_ / x2.val_);
22 }
23 
24 template <typename T>
multiply_log(const fvar<T> & x1,double x2)25 inline fvar<T> multiply_log(const fvar<T>& x1, double x2) {
26   using std::log;
27   return fvar<T>(multiply_log(x1.val_, x2), x1.d_ * log(x2));
28 }
29 }  // namespace math
30 }  // namespace stan
31 #endif
32