1#ifndef STAN_MATH_REV_FUN_GRAD_INC_BETA_HPP
2#define STAN_MATH_REV_FUN_GRAD_INC_BETA_HPP
43 var C =
exp(a * c1 + b * c2) / a;
49 std::forward_as_tuple(dF1, dF2, dF3, dFz)
50 = grad_2F1<true>(a + b,
var(1.0), a + 1, z);
52 g1 = (c1 - 1.0 / a) * c3 + C * (dF1 + dF3);
53 g2 = c2 * c3 + C * dF1;
double value_of_rec(const fvar< T > &v)
Return the value of the specified variable.
fvar< T > log(const fvar< T > &x)
void grad_inc_beta(fvar< T > &g1, fvar< T > &g2, fvar< T > a, fvar< T > b, fvar< T > z)
Gradient of the incomplete beta function beta(a, b, z) with respect to the first two arguments.
fvar< T > inc_beta(const fvar< T > &a, const fvar< T > &b, const fvar< T > &x)
fvar< T > log1m(const fvar< T > &x)
fvar< T > beta(const fvar< T > &x1, const fvar< T > &x2)
Return fvar with the beta function applied to the specified arguments and its gradient.
fvar< T > exp(const fvar< T > &x)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...