1#ifndef STAN_MATH_REV_FUN_FALLING_FACTORIAL_HPP
2#define STAN_MATH_REV_FUN_FALLING_FACTORIAL_HPP
15 [a, digamma_ab](
auto& vi)
mutable {
16 a.adj() += vi.adj() * vi.val() * digamma_ab;
20template <
typename T1,
typename T2, require_eigen_t<T1>* =
nullptr,
21 require_st_
integral<T2>* =
nullptr>
25 -
digamma(a.val().array() - b_map + 1));
28 a.adj().array() += vi.adj().array() * vi.val().array() * digamma_ab;
T as_array_or_scalar(T &&v)
Returns specified input value.
var_value< plain_type_t< T > > make_callback_var(T &&value, F &&functor)
Creates a new var initialized with a callback_vari with a given value and reverse-pass callback funct...
arena_t< T > to_arena(const T &a)
Converts given argument into a type that either has any dynamic allocation on AD stack or schedules i...
fvar< T > falling_factorial(const fvar< T > &x, int n)
Return autodiff variable with the gradient and result of the falling factorial function applied to th...
fvar< T > digamma(const fvar< T > &x)
Return the derivative of the log gamma function at the specified argument.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...