Stan Math Library
4.9.0
Automatic Differentiation
|
|
inline |
Return the natural log of the specified variable (cmath).
The derivative is defined by
\(\frac{d}{dx} \log x = \frac{1}{x}\).
\[ \mbox{log}(x) = \begin{cases} \textrm{NaN} & \mbox{if } x < 0\\ \ln(x) & \mbox{if } x \geq 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log}(x)}{\partial x} = \begin{cases} \textrm{NaN} & \mbox{if } x < 0\\ \frac{1}{x} & \mbox{if } x\geq 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
T | Arithmetic or a type inheriting from EigenBase . |
a | Variable whose log is taken. |