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

◆ trigamma() [3/6]

double stan::math::trigamma ( double  u)
inline

Return the second derivative of the log Gamma function evaluated at the specified argument.

\[ \mbox{trigamma}(x) = \begin{cases} \textrm{error} & \mbox{if } x\in \{\dots, -3, -2, -1, 0\}\\ \Psi_1(x) & \mbox{if } x\not\in \{\dots, -3, -2, -1, 0\}\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]

\[ \frac{\partial\, \mbox{trigamma}(x)}{\partial x} = \begin{cases} \textrm{error} & \mbox{if } x\in \{\dots, -3, -2, -1, 0\}\\ \frac{\partial\, \Psi_1(x)}{\partial x} & \mbox{if } x\not\in \{\dots, -3, -2, -1, 0\}\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]

\[ \Psi_1(x)=\sum_{n=0}^\infty \frac{1}{(x+n)^2} \]

\[ \frac{\partial \, \Psi_1(x)}{\partial x} = -2\sum_{n=0}^\infty \frac{1}{(x+n)^3} \]

Parameters
[in]uargument
Returns
second derivative of log Gamma function at argument

Definition at line 120 of file trigamma.hpp.