multiple_two_sum

Function multiple_two_sum 

Source
fn multiple_two_sum(xs: &[f64]) -> (f64, f64)
Examples found in repository?
crates/competitive/src/num/quad_double.rs (line 218)
197    fn mul(self, rhs: Self) -> Self::Output {
198        let (t0, q00) = two_prod(self.0, rhs.0);
199
200        let (p01, q01) = two_prod(self.0, rhs.1);
201        let (p10, q10) = two_prod(self.1, rhs.0);
202
203        let (p02, q02) = two_prod(self.0, rhs.2);
204        let (p11, q11) = two_prod(self.1, rhs.1);
205        let (p20, q20) = two_prod(self.2, rhs.0);
206
207        let (p03, q03) = two_prod(self.0, rhs.3);
208        let (p12, q12) = two_prod(self.1, rhs.2);
209        let (p21, q21) = two_prod(self.2, rhs.1);
210        let (p30, q30) = two_prod(self.3, rhs.0);
211
212        let p13 = self.1 * rhs.3;
213        let p22 = self.2 * rhs.2;
214        let p31 = self.3 * rhs.1;
215
216        let (t1, e1, e2) = three_three_sum(q00, p01, p10);
217        let (t2, e3, e4) = multiple_three_sum(&[e1, q01, q10, p02, p11, p20]);
218        let (t3, e5) = multiple_two_sum(&[e2, e3, q02, q11, q20, p03, p12, p21, p30]);
219        let t4 = e4 + e5 + q03 + q12 + q21 + q30 + p13 + p22 + p31;
220        Self::renormalize(t0, t1, t2, t3, t4)
221    }