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

◆ log1m() [4/6]

double stan::math::log1m ( double  x)
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} \]

Parameters
[in]xArgument.
Returns
Natural log of one minus the argument.
Exceptions
<code>std::domain_error</code>If the argument is greater than 1.
<code>std::overflow_error</code>If the computation overflows.

Definition at line 42 of file log1m.hpp.