Stan Math Library
5.0.0
Automatic Differentiation
|
|
inline |
Return the natural logarithm of one minus the specified value.
The main use of this function is to cut down on intermediate values during algorithmic differentiation.
\[ \mbox{log1m}(x) = \begin{cases} \ln(1-x) & \mbox{if } x \leq 1 \\ \textrm{NaN} & \mbox{if } x > 1\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log1m}(x)}{\partial x} = \begin{cases} -\frac{1}{1-x} & \mbox{if } x \leq 1 \\ \textrm{NaN} & \mbox{if } x > 1\\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
[in] | x | Argument. |
<code>std::domain_error</code> | If the argument is greater than 1. |
<code>std::overflow_error</code> | If the computation overflows. |