Stan Math Library
5.0.0
Automatic Differentiation
|
|
inline |
Return the rising factorial function evaluated at the inputs.
T | type of the first argument |
x | first argument |
n | second argument |
std::domain_error | if x is NaN |
std::domain_error | if 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.