Skip to main content

add_compensated

Function add_compensated 

Source
fn add_compensated(this: (f64, f64), other: (f64, f64)) -> (f64, f64)
Expand description

The compensated sum of two partial sums. Both the other sum and its compensation are added as Kahan addends: adding the compensation plainly would drop what the compensation already holds once later partials cancel the sums, as merging [1e100, 1], [-1e100, 1e84] and [-1e84] would lose the 1.