Vectorize with `logsumexp`?