Automatic Differentiation
 
Loading...
Searching...
No Matches

◆ log_falling_factorial() [4/8]

template<typename T1 , typename T2 , require_all_arithmetic_t< T1, T2 > * = nullptr>
return_type_t< T1, T2 > stan::math::log_falling_factorial ( const T1  x,
const T2  n 
)
inline

Return the natural log of the falling factorial of the specified arguments.

\[ \mbox{log\_falling\_factorial}(x, n) = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ \ln (x)_n & \mbox{if } x > 0 \textrm{ and } -\infty \leq n \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } n = \textrm{NaN} \end{cases} \]

\[ \frac{\partial\, \mbox{log\_falling\_factorial}(x, n)}{\partial x} = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ \Psi(x) & \mbox{if } x > 0 \textrm{ and } -\infty \leq n \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } n = \textrm{NaN} \end{cases} \]

\[ \frac{\partial\, \mbox{log\_falling\_factorial}(x, n)}{\partial n} = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ -\Psi(n) & \mbox{if } x > 0 \textrm{ and } -\infty \leq n \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN or } n = \textrm{NaN} \end{cases} \]

Template Parameters
T1type of first argument
T2type of second argument
Parameters
[in]xFirst argument
[in]nSecond argument
Returns
log of falling factorial of arguments
Exceptions
std::domain_errorif the first argument is not positive

Definition at line 55 of file log_falling_factorial.hpp.