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

◆ log1p_exp() [4/6]

double stan::math::log1p_exp ( double  a)
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.