Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
digamma.hpp
Go to the documentation of this file.
1 #ifndef STAN__AGRAD__FWD__FUNCTIONS__DIGAMMA_HPP
2 #define STAN__AGRAD__FWD__FUNCTIONS__DIGAMMA_HPP
3 
5 #include <stan/meta/traits.hpp>
6 #include <boost/math/special_functions/digamma.hpp>
8 
9 namespace stan {
10 
11  namespace agrad {
12 
13  template <typename T>
14  inline
15  fvar<T>
16  digamma(const fvar<T>& x) {
19  return fvar<T>(digamma(x.val_), x.d_ * trigamma(x.val_));
20  }
21  }
22 }
23 #endif
T trigamma(T x)
Definition: trigamma.hpp:49
double digamma(double x)
Definition: digamma.hpp:39
fvar< T > digamma(const fvar< T > &x)
Definition: digamma.hpp:16

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