while G*, Hi*, and H2* [see (37)] are the unique polynomials (in ~[Xa , ""
with eoeffieients (in 9) of degree (in
less than n, such that
G (i) rood (xv -
H,* ------ //~) rood (x, -
1/12 mod (x, -
Now as soon as e = d, weseefrom (51)and (53) that (38 holds.
When we also achieve
n > , = max (0v (0), o~ (/it,), 0~ (/72) ),
where 0v denotes the degree in x,, it follows that (40) holds. To obtain the final
results, we then use (41) and (42) as in Algorithm ~[.
Although the preceding discussion is sufficient in principle to define Algorithm P,
the interested reader may find it instructive to compare the following detailed
description with the earlier presentation (Section 4.3) of Algorithm M.
1, then F, and F'
2 are elements of 9 invoke Algorithm U to comput
G' = gcd(F,', F(), and return. Otherwise use Algorithm U to compute 0 = eont(Fl' )
c2 = cont(F2'), c = gcd(o, c2).
Set F~ =
Fl'/C,, F~ = F2'/c2.
Set fl = lc(F,), f~ = lc(F2), 0 = gcd(f,, f2).
Set n = 0, e = min (~(F,), O(F~)).
Set ~, = 0~(0) +
O~(F,), ~2 = 0~(0) + O~(F2),
~ = max(p,, P2). It follows
that h = 0~ (f,) = 0~ (G) + 0v (/4,), ~2 = 0~ (f~) = 0~ (G) + 0~. (/t2), and v > ,.
Let b be a new element of Z, such that
b) ~ fir2.
If Zp is exhausted,
then p is too small and the algorithm fails.
Set 0 = 0 mod(x~ --
b), IP~ = OF,
b), F2 = 0F2 mod(x~ -- b).
Invoke Algorithm P reeursively to compute G = g" ged
(F~, F2), lq, = IPl/G,
and tq2 = F2/G, all in
9b[xl, "" ,
... , xv ,]. These relations imply
= g, andl)(G) > d.
If it(G) = 0, set G =
1, Hi =
Fx, He = F2, and skip to Step (15). If
i} (G) > e, go back to Step (6). If i} (G) < e, set n = 0, e = ~ (G).
If n = 1, set q = p, G* = G, H,* = /q, , H2* = ~q~ . Otherwise, update the
(q, G*, H~*, H2*)
G, /7,, H~) by using the Chinese re-
mainder algorithm (Section 4.8) (which in this ease is a form of interpolation [1,
p. 430]) with moduli mi = q and m~ =
Xv -- b to extend (53) (coefficient by co-
efficient), and then replaeing q by
q(x~ -- b)
to extend (52).
Ifn < ~, go baek to Step (6). Otherwise, we now know thatn > ~ > ~,so
(40) holds unless e > d. To exclude this unlikely possibility, it suffiees to prove the
= ff~ and
= ~0~, which hold modulo q by (33), (49), (52),