Compute f(a) = log(1 - exp(-a)) quickly and numerically accurately.
log1mexp() is simple pure R code;
log1mexpC() is an interface to R C API (Rmathlib)
function.
log1pexpC() is an interface to R C API (Rmathlib)
double function log1pexp() which computes \(\log(1 +
\exp(x))\), accurately, notably for large \(x\), say, \(x > 720\).
# NOT RUN {l1m.xy <- curve(log1mexp(x), -10, 10, n=1001)
stopifnot(with(l1m.xy, all.equal(y, log1mexpC(x))))
# }# NOT RUN {<!-- %% FIXME: add example for log1pexp() -->
# }