logaddexp-rs
Stable implementations of logaddexp and logsumexp in rust. Computing
log(sum_i(exp(v_i))) naively can easily overflow. This crate provides
implementations for two values (ln_add_exp) and many values (ln_sum_exp)
that are more stable (less prone to overflow) than the naive computation.
Usage
Run
Then import the trait you want to use and call the function on the appropriate types
use LogAddExp;
f64ln_add_exp;
use LogSumExp;
.into_iter.ln_sum_exp;