Automatic Differentiation
 
Loading...
Searching...
No Matches
digamma.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_FWD_FUN_DIGAMMA_HPP
2#define STAN_MATH_FWD_FUN_DIGAMMA_HPP
3
7
9
10namespace stan {
11namespace math {
12
22template <typename T>
23inline fvar<T> digamma(const fvar<T>& x) {
24 return fvar<T>(digamma(x.val_), x.d_ * trigamma(x.val_));
25}
26
27} // namespace math
28} // namespace stan
29#endif
fvar< T > trigamma(const fvar< T > &u)
Return the value of the trigamma function at the specified argument (i.e., the second derivative of t...
Definition trigamma.hpp:25
fvar< T > digamma(const fvar< T > &x)
Return the derivative of the log gamma function at the specified argument.
Definition digamma.hpp:23
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Scalar val_
The value of this variable.
Definition fvar.hpp:49
Scalar d_
The tangent (derivative) of this variable.
Definition fvar.hpp:61
This template class represents scalars used in forward-mode automatic differentiation,...
Definition fvar.hpp:40