LogAddExp

Trait LogAddExp 

Source
pub trait LogAddExp<Rhs = Self> {
    type Output;

    // Required method
    fn ln_add_exp(self, other: Rhs) -> Self::Output;
}
Expand description

A trait for computing ln_add_exp

Required Associated Types§

Source

type Output

The result of the computation

Required Methods§

Source

fn ln_add_exp(self, other: Rhs) -> Self::Output

Compute the log of the addition of the exponentials

This computes the same value value as (self.exp() + other.exp()).ln() but in a more numerically stable way then computing it using that formula.

§Examples
use logaddexp::LogAddExp;
100_f64.ln().ln_add_exp(0.0); // 101_f64.ln()

Implementors§

Source§

impl<'a, T> LogAddExp<&'a T> for T
where T: Float + FloatConst,

Source§

impl<T> LogAddExp for T
where T: Float + FloatConst,