Stan Math Library
4.9.0
Automatic Differentiation
|
|
inline |
Calculates the log of 1 plus the exponential of the specified value without overflow.
This function is related to other special functions by:
log1p_exp(x)
= log1p(exp(a))
= log(1 + exp(x))
= log_sum_exp(0, x)
.
\[ \mbox{log1p\_exp}(x) = \begin{cases} \ln(1+\exp(x)) & \mbox{if } -\infty\leq x \leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
\[ \frac{\partial\, \mbox{log1p\_exp}(x)}{\partial x} = \begin{cases} \frac{\exp(x)}{1+\exp(x)} & \mbox{if } -\infty\leq x\leq \infty \\[6pt] \textrm{NaN} & \mbox{if } x = \textrm{NaN} \end{cases} \]
Definition at line 45 of file log1p_exp.hpp.