1#ifndef STAN_MATH_FWD_FUN_GAMMA_Q_HPP
2#define STAN_MATH_FWD_FUN_GAMMA_Q_HPP
15 using boost::math::digamma;
32 while (
fabs(delta) > 1
e-6) {
36 delta = s / ((k + x1.
val_) * (k + x1.
val_));
39 T der1 = (1.0 - u) * (dig - l) +
exp(x1.
val_ * l) * S / g;
47 using boost::math::digamma;
64 while (
fabs(delta) > 1
e-6) {
68 delta = s / ((k + x1.
val_) * (k + x1.
val_));
71 T der1 = (1.0 - u) * (dig - l) +
exp(x1.
val_ * l) * S / g;
static constexpr double e()
Return the base of the natural logarithm.
auto pow(const T1 &x1, const T2 &x2)
fvar< T > log(const fvar< T > &x)
fvar< T > tgamma(const fvar< T > &x)
Return the result of applying the gamma function to the specified argument.
fvar< T > gamma_q(const fvar< T > &x1, const fvar< T > &x2)
fvar< T > digamma(const fvar< T > &x)
Return the derivative of the log gamma function at the specified argument.
fvar< T > fabs(const fvar< T > &x)
fvar< T > exp(const fvar< T > &x)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Scalar val_
The value of this variable.
Scalar d_
The tangent (derivative) of this variable.
This template class represents scalars used in forward-mode automatic differentiation,...