1#ifndef STAN_MATH_FWD_FUN_GAMMA_Q_HPP
2#define STAN_MATH_FWD_FUN_GAMMA_Q_HPP
31 while (
fabs(delta) > 1
e-6) {
35 delta = s / ((k + x1.
val_) * (k + x1.
val_));
38 T der1 = (1.0 - u) * (dig - l) +
exp(x1.
val_ * l) * S / g;
56 while (
fabs(delta) > 1
e-6) {
60 delta = s / ((k + x1.
val_) * (k + x1.
val_));
63 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,...