Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
exp2.hpp
Go to the documentation of this file.
1 #ifndef STAN__AGRAD__FWD__FUNCTIONS__EXP2_HPP
2 #define STAN__AGRAD__FWD__FUNCTIONS__EXP2_HPP
3 
5 #include <stan/meta/traits.hpp>
8 
9 namespace stan {
10 
11  namespace agrad {
12 
13  template <typename T>
14  inline
15  fvar<T>
16  exp2(const fvar<T>& x) {
17  using stan::math::exp2;
18  using std::log;
19  return fvar<T>(exp2(x.val_), x.d_ * exp2(x.val_) * stan::math::LOG_2);
20  }
21  }
22 }
23 #endif
const double LOG_2
The natural logarithm of 2, .
Definition: constants.hpp:32
fvar< T > exp2(const fvar< T > &x)
Definition: exp2.hpp:16
boost::math::tools::promote_args< T >::type exp2(const T y)
Return the exponent base 2 of the specified argument (C99).
Definition: exp2.hpp:23
fvar< T > log(const fvar< T > &x)
Definition: log.hpp:15

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