[go: up one dir, main page]

[][src]Function accurate::util::two_sum

pub fn two_sum<F>(a: F, b: F) -> (F, F) where
    F: TwoSum

Sum transformation

Transforms a sum a + b into the pair (x, y) where

x = fl(a + b)

is the sum of a and b with floating point rounding applied and

y = a + b - x

is the remainder of the addition.

References

From Knuth's AoCP, Volume 2: Seminumerical Algorithms