# NOT RUN {
# complete underflow without sumlog
x <- c(-750,-752)
log(sum(exp(x)))
sumlog(x)
# imprecise sum
x <- c(-745,-752)
log(sum(exp(x)))
sumlog(x)
# no issues
x <- c(log(3),log(2))
log(5)
log(sum(exp(x)))
sumlog(x)
# }
Run the code above in your browser using DataLab