log_sum_exp(0,x)
showed up in the simplex transform when I rearranged
terms to try to prevent overflow.
So I built a special function (and class in auto-dif)
for it. Here's the definition:
log1p_exp(x) = log_sum_exp(0,x)
= log(exp(0) + exp(x))
= log(1 + exp(x))
= log1p(exp(x))
and function signatures:
double stan::math::log1p_exp(double x);
var stan::agrad::log1p_exp(const var& a);
- Bob