a <- 2^seq(-58,10, length = 256)
fExpr <- expression(
log(1 - exp(-a)),
log(-expm1(-a)),
log1p(-exp(-a)),
log1mexp(a))
names(fExpr) <- c("DEF", "expm1", "log1p", "F")
str(fa <- do.call(cbind, as.list(fExpr)))
matplot(a, fa, type = "l", log = "x")# don't see the big difference
legend("topleft", fExpr, col=1:4, lty=1:4, bty="n")
head(fa)# expm1() works here
tail(fa)# log1p() works here
matplot(a, -fa, type = "l", log = "xy")# don't see the big difference
legend("left", fExpr, col=1:4, lty=1:4, bty="n")
Run the code above in your browser using DataLab