uint icon indicating copy to clipboard operation
uint copied to clipboard

`algorithms/gcd/gcd_old`: Can we reuse the shifted variables here?

Open github-actions[bot] opened this issue 2 years ago • 0 comments

On 2022-06-06 @recmo wrote in 4c74c09 “Merge pull request #110 from recmo/gcd”:

Can we reuse the shifted variables here?

    // We can return q here and have a perfectly valid single-word Lehmer GCD.
    // return q;

    // Recompute r0 and r1 and take the high bits.
    // OPT: This does not need full precision.
    // OPT: Can we reuse the shifted variables here?
    lehmer_update(&mut r0, &mut r1, &q);
    let s = r0.leading_zeros();
    let r0s = r0 << s;
    let r1s = r1 << s;
    let qn = lehmer_loop(r0s.limb(3), r1s.limb(3));

From src/algorithms/gcd/gcd_old.rs:311

github-actions[bot] avatar Jun 06 '22 03:06 github-actions[bot]