1 #ifndef STAN_MATH_REV_SCAL_FUN_DIGAMMA_HPP 2 #define STAN_MATH_REV_SCAL_FUN_DIGAMMA_HPP 12 class digamma_vari :
public op_v_vari {
14 explicit digamma_vari(vari* avi) :
15 op_v_vari(
digamma(avi->val_), avi) {
18 avi_->adj_ += adj_ *
trigamma(avi_->val_);
24 return var(
new digamma_vari(a.
vi_));
Independent (input) and dependent (output) variables for gradients.
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...
vari * vi_
Pointer to the implementation of this variable.
fvar< T > digamma(const fvar< T > &x)
Return the derivative of the log gamma function at the specified argument.