1#ifndef STAN_MATH_REV_FUN_GAMMA_P_HPP
2#define STAN_MATH_REV_FUN_GAMMA_P_HPP
39 if (std::fabs(
bvi_->val_ /
avi_->val_) > 10) {
46 * std::exp(-
bvi_->val_ + (
avi_->val_ - 1.0) * std::log(
bvi_->val_)
67 if (std::fabs(
bd_ /
avi_->val_) > 10) {
91 if (std::fabs(
bvi_->val_ /
ad_) > 10) {
96 * std::exp(-
bvi_->val_ + (
ad_ - 1.0) * std::log(
bvi_->val_)
gamma_p_dv_vari(double a, vari *bvi)
gamma_p_vd_vari(vari *avi, double b)
gamma_p_vv_vari(vari *avi, vari *bvi)
static constexpr double NOT_A_NUMBER
(Quiet) not-a-number value.
fvar< T > lgamma(const fvar< T > &x)
Return the natural logarithm of the gamma function applied to the specified argument.
fvar< T > gamma_p(const fvar< T > &x1, const fvar< T > &x2)
int is_inf(const fvar< T > &x)
Returns 1 if the input's value is infinite and 0 otherwise.
return_type_t< T1, T2 > grad_reg_lower_inc_gamma(const T1 &a, const T2 &z, double precision=1e-10, int max_steps=1e5)
Computes the gradient of the lower regularized incomplete gamma function.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...