log.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_FWD_SCAL_FUN_LOG_HPP
2 #define STAN_MATH_FWD_SCAL_FUN_LOG_HPP
3 
4 #include <stan/math/fwd/core.hpp>
5 
7 
8 namespace stan {
9 namespace math {
10 
11 template <typename T>
12 inline fvar<T> log(const fvar<T>& x) {
13  using std::log;
14  if (x.val_ < 0.0)
16  else
17  return fvar<T>(log(x.val_), x.d_ / x.val_);
18 }
19 } // namespace math
20 } // namespace stan
21 #endif
const double NOT_A_NUMBER
Definition: constants.hpp:53
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:12
var log(const var &a)
Definition: log.hpp:46