Toom-3: operate more on values where possible

This commit is contained in:
Josh Stone 2017-09-20 13:17:06 -07:00
parent 2c2e46c8df
commit 28d84ca3ac
1 changed files with 5 additions and 5 deletions

View File

@ -417,14 +417,14 @@ fn mac3(acc: &mut [BigDigit], b: &[BigDigit], c: &[BigDigit]) {
let r0 = &x0 * &y0;
let r4 = &x2 * &y2;
let r1 = (&p + &x1) * (&q + &y1);
let r1 = (p + x1) * (q + y1);
let r2 = &p2 * &q2;
let r3 = ((p2 + x2)*2 - x0) * ((q2 + y2)*2 - y0);
let mut comp3: BigInt = (&r3 - &r1) / 3;
let mut comp1: BigInt = (&r1 - &r2) / 2;
let mut comp2: BigInt = &r2 - &r0;
comp3 = (&comp2 - &comp3)/2 + &r4*2;
let mut comp3: BigInt = (r3 - &r1) / 3;
let mut comp1: BigInt = (r1 - &r2) / 2;
let mut comp2: BigInt = r2 - &r0;
comp3 = (&comp2 - comp3)/2 + &r4*2;
comp2 = comp2 + &comp1 - &r4;
comp1 = comp1 - &comp3;