In comparing the primitive PRS algorithm and the subresultant PRS algorithm,
we must compare the cost of computing the primitive part at each step with the
advantage of having possibly smaller coefficients. In most cases, the primitive-part
calculations represent a substantial fraction of the total effort in the primitive PRS
algorithm, and there is little if any compensating advantage. However, there may
conceivably be some cases in which the subresultant PRS diverges so far from the
primitive PRS that the primitive PRS algorithm is actually faster.
4.
The Modular Algorithm
4.1
INTRODUCTION. Let F be a nonzero polynomial with integer coefficients. Letf
denote the leading coefficient of F, and let p be a prime which does not divide f.
Then if F is irreducible over the integers modulo p, it is also irreducible over the
integers. This fact has long been exploited by those interested in polynomial fac-
toring.
Similarly, let F1 and F2 be nonzero polynomials with leading coefficients fl and f:,
and let p be a prime which does not divide fl or f2 • Then if F~ and F2 are relatively
prime over the integers modulo p, they are relatively prime over the integers. Even
if F1 and F2 are not relatively prime, the computation of their GCD over the integers
modulo p may provide useful information concerning their GCD over the integers.
We shall develop this idea into a general algorithm (Section 4.3) for computing
the GCD of univariate or multivariate polynomials over the integers.
4.2
BASICCONCEPTS. Let 9 be a unique factorization domain in which GCD's
can somehow be computed, and let 9[xl, • • • , xv] denote the domain of polynomials
in xl, • • • , xv with coefficients in 9. When v >
1, we shall
not
view the elements of
this domain as polynomials in xl with coefficients in 9[x2, • • • , xv]. Instead, we shall
generalize the concepts of Section 2 to apply directly to multivariate polynomials.
Let the
exponent vector
of a term be the vector of its exponents, and define the
lexicographical ordering
of exponent vectors d =
(dl, - - • , dr) and e =
(el, • • • , ev)
as follows. If d/ = el for i = 1, • • • , v, then d = e. Otherwise, let j be the smallest
integer such that dj # e~. If dj < ej, then d < e, while if dj > e~, then d > e. As-
suming that the terms of a polynomial F are arranged in lexicographically decreasing
Journal of the Association for Computing Machinery, Vol. 18, No. 4, October 1971