Skip to main content

relative_error

Function relative_error 

Source
pub fn relative_error<T: Float>(computed: T, reference: T) -> T
Expand description

Relative error between computed and reference: |computed - reference| / |reference|.

Returns T::infinity() when reference is zero and computed is non-zero. Returns T::zero() when both are zero.