fn two_prod(a: f64, b: f64) -> (f64, f64)Examples found in repository?
crates/competitive/src/num/double_double.rs (line 104)
103 fn mul(self, rhs: f64) -> Self::Output {
104 let (t0, e0) = two_prod(self.0, rhs);
105 let p1 = self.1 * rhs;
106 let (t1, t2) = two_sum(p1, e0);
107 Self::renormalize(t0, t1, t2)
108 }
109}
110
111impl Mul<DoubleDouble> for DoubleDouble {
112 type Output = Self;
113 fn mul(self, rhs: Self) -> Self::Output {
114 let (t0, q00) = two_prod(self.0, rhs.0);
115 let (p01, q01) = two_prod(self.0, rhs.1);
116 let (p10, q10) = two_prod(self.1, rhs.0);
117 let p11 = self.1 * rhs.1;
118 let (t1, e1) = three_two_sum(q00, p01, p10);
119 let t2 = e1 + q01 + q10 + p11;
120 Self::renormalize(t0, t1, t2)
121 }