Adapted from https://stat.ethz.ch/pipermail/r-help/2011-February/269205.html
.logsumexp(xs)
xs
input vector
log of summed exponentials