Overflow-safe log(cosh(x)) and log(exp(x) + exp(y)).
Pure-Rust port of limma’s logsumexp.R (logcosh and logsumexp).
Both avoid floating overflow/underflow: logcosh uses a small-x Taylor
term and a large-x linear tail, and logsumexp reduces to logcosh of the
half-difference.