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

◆ rising_factorial() [2/4]

template<typename T , require_arithmetic_t< T > * = nullptr>
return_type_t< T > stan::math::rising_factorial ( const T &  x,
int  n 
)
inline

Return the rising factorial function evaluated at the inputs.

Template Parameters
Ttype of the first argument
Parameters
xfirst argument
nsecond argument
Returns
Result of rising factorial function.
Exceptions
std::domain_errorif x is NaN
std::domain_errorif n is negative

\[ \mbox{rising\_factorial}(x, n) = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ 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{rising\_factorial}(x, n)}{\partial x} = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ \frac{\partial\, x^{(n)}}{\partial 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{rising\_factorial}(x, n)}{\partial n} = \begin{cases} \textrm{error} & \mbox{if } x \leq 0\\ \frac{\partial\, x^{(n)}}{\partial 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} \]

\[ x^{(n)}=\frac{\Gamma(x+n)}{\Gamma(x)} \]

\[ \frac{\partial \, x^{(n)}}{\partial x} = x^{(n)}(\Psi(x+n)-\Psi(x)) \]

\[ \frac{\partial \, x^{(n)}}{\partial n} = (x)_n\Psi(x+n) \]

Definition at line 63 of file rising_factorial.hpp.