Stan Math Library
5.0.0
Automatic Differentiation
|
|
inline |
Returns the base 2 logarithm of the specified variable (C99).
See log2() for the double-based version.
The derivative is
\(\frac{d}{dx} \log_2 x = \frac{1}{x \log 2}\).
\[ \mbox{log2}(x) = \begin{cases} \textrm{NaN} & \mbox{if } x < 0 \\ \log_2(x) & \mbox{if } x\geq 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log2}(x)}{\partial x} = \begin{cases} \textrm{NaN} & \mbox{if } x < 0 \\ \frac{1}{x\ln2} & \mbox{if } x\geq 0 \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
T | Arithmetic or a type inheriting from EigenBase . |
a | The variable. |