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

◆ log_rising_factorial() [4/8]

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

Return the natural logarithm of the rising factorial from the first specified argument to the second.

\[ \mbox{log\_rising\_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\_rising\_factorial}(x, n)}{\partial x} = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ \Psi(x+n) - \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\_rising\_factorial}(x, n)}{\partial n} = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ \Psi(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} \]

Template Parameters
T1type of first argument x
T2type of second argument n
Parameters
[in]xfirst argument
[in]nsecond argument
Returns
natural logarithm of the rising factorial from x to n
Exceptions
std::domain_errorif the first argument is not positive

Definition at line 53 of file log_rising_factorial.hpp.