Skip to main content

two_sum

Function two_sum 

Source
pub fn two_sum(a: f64, b: f64) -> (f64, f64)
Expand description

(s, e) with s = fl(a + b) and s + e = a + b exactly (Knuth’s TwoSum: 6 flops, no branch, no condition on the operands). Exact unless s overflows — or a = ±Ω, where an intermediate difference can overflow and leave e non-finite (invariant T1 of Chapter 11.1).