## An analysis of the generalized binary GCD algorithm (2007)

Venue: | HIGH PRIMES AND MISDEMEANORS, LECTURES IN HONOUR OF HUGH COWIE |

Citations: | 5 - 2 self |

### BibTeX

@INPROCEEDINGS{Sorenson07ananalysis,

author = {Jonathan P. Sorenson},

title = {An analysis of the generalized binary GCD algorithm },

booktitle = {HIGH PRIMES AND MISDEMEANORS, LECTURES IN HONOUR OF HUGH COWIE},

year = {2007},

pages = {247--252},

publisher = {}

}

### OpenURL

### Abstract

In this paper we analyze a slight modification of Jebelean’s version of the k-ary GCD algorithm. Jebelean had shown that on n-bit inputs, the algorithm runs in O(n²) time. In this paper, we show that the average running time of our modified algorithm is O(n²/ log n). This analysis involves exploring the behavior of spurious factors introduced during the main loop of the algorithm. We also introduce a Jebeleanstyle left-shift k-ary GCD algorithm with a similar complexity that performs well in practice.

### Citations

2467 | S.: Handbook of Applied Cryptography
- Menezes, Oorschot, et al.
- 1996
(Show Context)
Citation Context ...v. Computing GCDs is a fundamentally important operation, and has applications in all branches of algorithmic and computational number theory, including almost all cryptosystems based on number theory=-=[2, 14]-=-. Perhaps the most famous algorithm for computing GCDs is the ancient algorithm of Euclid. On inputs u, v of at most n bits in length, Euclid’s algorithm will compute gcd(u, v) using O(n 2 ) bit opera... |

2056 | Handbook of mathematical functions - Abramowitz, Stegun - 1965 |

847 |
M.: An Introduction to the Theory of Numbers
- Hardy, Wright
- 1954
(Show Context)
Citation Context ... log y (6.13) Note that 1 ≤ c(x, y) ≤ 9. Proof From Ennola [7] (see also [10]) we have that (log x)π(y) � � � 1 y Ψ(x, y) = 1 + O π(y)! log p 2 �� . (6.14) log x log y p≤y By the prime number theorem =-=[9]-=- we have π(y) = (y/ log y)(1 + O(1/ log y)). Using Stirling’s formula for n! (see [1, 6.1.38]) we deduce that � � �� log log y log π(y)! = y · 1 + O . (6.15) log y We have log(log x) π(y) = π(y) log l... |

268 | An Introduction to the Analysis of Algorithms - Sedgewick, Flajolet - 1996 |

255 |
The Art of Computer Programming, Seminumerical Algorithms Volume 2, third edition
- Knuth
- 1998
(Show Context)
Citation Context ...log n) bit operations. This algorithm is based on FFT arithmetic and is only practical for very large inputs. The algorithms that are used the most in practice today are probably the binary algorithm =-=[12, 21]-=- and Euclid’s algorithm for smaller numbers, and either Lehmer’s algorithm [13, 20] or Jebelean’s version of the k-ary GCD algorithm [11, 19, 22] for larger numbers. The binary algorithm has an O(n 2 ... |

60 |
Schnelle Berechnung von Kettenbruchentwicklungen
- Schönhage
- 1971
(Show Context)
Citation Context ...f Euclid. On inputs u, v of at most n bits in length, Euclid’s algorithm will compute gcd(u, v) using O(n 2 ) bit operations [4, 5]. The fastest known algorithm for computing GCDs is that of Schönhage=-=[16]-=-, which takes O(n(log n) 2 log log n) bit operations. This algorithm is based on FFT arithmetic and is only practical for very large inputs. The algorithms that are used the most in practice today are... |

33 |
The accelerated integer GCD algorithm
- Weber
- 1995
(Show Context)
Citation Context ...e most in practice today are probably the binary algorithm [12, 21] and Euclid’s algorithm for smaller numbers, and either Lehmer’s algorithm [13, 20] or Jebelean’s version of the k-ary GCD algorithm =-=[11, 19, 22]-=- for larger numbers. The binary algorithm has an O(n 2 ) running time, and both Lehmer’s algorithm and Sorenson’s version of the k-ary algorithm take at most O(n 2 / log n) time. In practice, as we wi... |

29 |
Computational Problems Associated with Racah Algebra
- Stein
- 1967
(Show Context)
Citation Context ...log n) bit operations. This algorithm is based on FFT arithmetic and is only practical for very large inputs. The algorithms that are used the most in practice today are probably the binary algorithm =-=[12, 21]-=- and Euclid’s algorithm for smaller numbers, and either Lehmer’s algorithm [13, 20] or Jebelean’s version of the k-ary GCD algorithm [11, 19, 22] for larger numbers. The binary algorithm has an O(n 2 ... |

28 |
Euclid’s algorithm for large numbers
- Lehmer
- 1938
(Show Context)
Citation Context ...cal for very large inputs. The algorithms that are used the most in practice today are probably the binary algorithm [12, 21] and Euclid’s algorithm for smaller numbers, and either Lehmer’s algorithm =-=[13, 20]-=- or Jebelean’s version of the k-ary GCD algorithm [11, 19, 22] for larger numbers. The binary algorithm has an O(n 2 ) running time, and both Lehmer’s algorithm and Sorenson’s version of the k-ary alg... |

24 |
Two Fast GCD Algorithms
- Sorenson
- 1994
(Show Context)
Citation Context ...e most in practice today are probably the binary algorithm [12, 21] and Euclid’s algorithm for smaller numbers, and either Lehmer’s algorithm [13, 20] or Jebelean’s version of the k-ary GCD algorithm =-=[11, 19, 22]-=- for larger numbers. The binary algorithm has an O(n 2 ) running time, and both Lehmer’s algorithm and Sorenson’s version of the k-ary algorithm take at most O(n 2 / log n) time. In practice, as we wi... |

21 |
The number of steps in the Euclidean algorithm
- Dixon
- 1970
(Show Context)
Citation Context ...aps the most famous algorithm for computing GCDs is the ancient algorithm of Euclid. On inputs u, v of at most n bits in length, Euclid’s algorithm will compute gcd(u, v) using O(n 2 ) bit operations =-=[4, 5]-=-. The fastest known algorithm for computing GCDs is that of Schönhage[16], which takes O(n(log n) 2 log log n) bit operations. This algorithm is based on FFT arithmetic and is only practical for very ... |

19 |
Algorithmic Number Theory - Volume 1
- Bach, Shallit
- 1996
(Show Context)
Citation Context ...v. Computing GCDs is a fundamentally important operation, and has applications in all branches of algorithmic and computational number theory, including almost all cryptosystems based on number theory=-=[2, 14]-=-. Perhaps the most famous algorithm for computing GCDs is the ancient algorithm of Euclid. On inputs u, v of at most n bits in length, Euclid’s algorithm will compute gcd(u, v) using O(n 2 ) bit opera... |

19 |
A generalization of the binary gcd algorithm
- Jebelean
- 1993
(Show Context)
Citation Context ...e most in practice today are probably the binary algorithm [12, 21] and Euclid’s algorithm for smaller numbers, and either Lehmer’s algorithm [13, 20] or Jebelean’s version of the k-ary GCD algorithm =-=[11, 19, 22]-=- for larger numbers. The binary algorithm has an O(n 2 ) running time, and both Lehmer’s algorithm and Sorenson’s version of the k-ary algorithm take at most O(n 2 / log n) time. In practice, as we wi... |

14 |
Efficient Algorithms for Computing the Jacobi Symbol
- EIKENBERRY, SORENSON
- 1996
(Show Context)
Citation Context ...ll powers of 2 from x and returns as its function value the number of 2s removed. The findab(u,v,k) function returns a pair of integers (a, b) such that au + bv ≡ 0(modk) with 0 < |a|, |b| ≤ √ k. See =-=[11, 6, 18, 22]-=- for algorithms for findab that take O((log k) 2 ) bit operations. The Euclid(g,x,y) function returns g = gcd(x, y) using Euclid’s algorithm. Algorithm GenBin(g, u, v): /** Returns g = gcd(u, v). **/ ... |

12 |
Algorithm and bound for the greatest common divisor of n integers
- Bradley
- 1970
(Show Context)
Citation Context ...similar in effect to Lehmer’s algorithm. For the right-shift case, one would want ad − bc to be a power of 2; this can be accomplished by repeatedly doubling c and d and performing Bradley reductions =-=[3]-=-, which keep c, d bounded by a, b in absolute value. The author has tried this technique for the case of a table-driven fast singleprecision GCD algorithm that seemed to perform very well. Details wil... |

7 |
Integers without large prime factors, Journal de Theorie des Nombres de Bordeaux 5
- Hildebrand, Tenenbaum
- 1993
(Show Context)
Citation Context ...ctors.) Definition 4.2 Let P (x) denote the largest prime factor of x, and we say that an integer x is y-smooth if P (x) ≤ y. We also define Ψ(x, y) to be the number of y-smooth integers up to x (see =-=[10]-=-). Then we see that s is √ k-smooth. We will take advantage of this observation in the following sections. In practice, it has been observed that s is usually quite small, so that the two Euclidean GC... |

7 | An Analysis of Lehmer’s Euclidean GCD Algorithm
- Sorenson
- 1995
(Show Context)
Citation Context ... a total time of O(n 2 / log n) up to the end of the main loop, including precomputation, but excluding the division steps. To handle the Euclidean steps, we borrow the analysis of Lehmer’s algorithm =-=[20]-=-, which gives a similar situation: O(n/ log n) loop iterations, with a Euclidean step each iteration. Let r denote the number of loop iterations, and qi the quotient computed by the Euclidean step tha... |

6 |
The computing time of the Euclidean algorithm
- Collins
(Show Context)
Citation Context ...aps the most famous algorithm for computing GCDs is the ancient algorithm of Euclid. On inputs u, v of at most n bits in length, Euclid’s algorithm will compute gcd(u, v) using O(n 2 ) bit operations =-=[4, 5]-=-. The fastest known algorithm for computing GCDs is that of Schönhage[16], which takes O(n(log n) 2 log log n) bit operations. This algorithm is based on FFT arithmetic and is only practical for very ... |

5 |
Counting the Integers Factorable via Cyclotomic Methods
- Pomerance, Sorenson
- 1995
(Show Context)
Citation Context ... maximum divisor of v with P (h) ≤ y. Let ɛ > 0, and m > 0 satisfying log m > (log y) 1+ɛ . Then the probability h > m is bounded by exp(−(log m) ɛ ). Proof This follows immediately from Lemma 2.4 in =-=[15]-=-. We apply this with y = √ k and m = 2d2, so we can choose ɛ = 1 here. It remains to show that inputs that fail to be well behaved due to the third condition are rare. To do this, we require several p... |

4 |
Improvements on the accelerated integer GCD algorithm
- Sedjelmaci, Lavault
- 1997
(Show Context)
Citation Context ...ll powers of 2 from x and returns as its function value the number of 2s removed. The findab(u,v,k) function returns a pair of integers (a, b) such that au + bv ≡ 0(modk) with 0 < |a|, |b| ≤ √ k. See =-=[11, 6, 18, 22]-=- for algorithms for findab that take O((log k) 2 ) bit operations. The Euclid(g,x,y) function returns g = gcd(x, y) using Euclid’s algorithm. Algorithm GenBin(g, u, v): /** Returns g = gcd(u, v). **/ ... |

3 |
On numbers with small prime divisors
- Ennola
- 1969
(Show Context)
Citation Context ...ers with (log x) 1/10 ≤ y ≤ (log x) 1/2 . Then � � �� log log y log Ψ(x, y) = c(x, y) · y · 1 + O log y (6.12) where log log x c(x, y) = − 1. log y (6.13) Note that 1 ≤ c(x, y) ≤ 9. Proof From Ennola =-=[7]-=- (see also [10]) we have that (log x)π(y) � � � 1 y Ψ(x, y) = 1 + O π(y)! log p 2 �� . (6.14) log x log y p≤y By the prime number theorem [9] we have π(y) = (y/ log y)(1 + O(1/ log y)). Using Stirling... |