对于输入B和C,利用Sorenson的右移k-ary消减(right-shift k-ary reduction)思想提出一种算法用于寻找整数x和y,使得x和y满足Bx-Cy在二进制表示下低比特位部分为0,利用该算法能够大规模降低循环次数,再结合模算法,提出递归最大公因子算法。递归最大公因子算法复杂度虽然对Knuth-Schnhage算法的复杂度上没有提高,仍然是O(nlog2nloglogn),但是该算法相比于Knuth-Schnhage算法实现简单,正确性分析和复杂度分析都比较容易。
For input B and C,an algorithm for finding the integers x and y,such that x and y satisfy the least significant bits of Bx- Cy were 0,is presented based on right-shift k-ary reduction proposed by Sorenson. It can reduce a large number of cycles by using the algorithm to find the integers x and y. A recursive GCD algorithm is proposed combined with mold algorithm. When the size of the input is n bits,the complexity of the recursive GCD algorithm is O( nlog~2nloglogn). Compared to KnuthSchnhage algorithm,our algorithm is easier to implement. Also it is easier to prove and analyze.