def _degree_bound_univariate(f, g):
 gamma = f.ring.domain.gcd(f.LC, g.LC)
 p = 1
 p = nextprime(p)
 while ((gamma % p) == 0):
  p = nextprime(p)
 fp = f.trunc_ground(p)
 gp = g.trunc_ground(p)
 hp = _gf_gcd(fp, gp, p)
 deghp = hp.degree()
 return deghp

def _degree_bound_univariate ( f , g ) : gamma = f . ring . domain . gcd ( f . LC , g . LC ) p = 1 p = nextprime ( p ) while ( ( gamma % p ) == 0 ) : p = nextprime ( p ) fp = f . trunc_ground ( p ) gp = g . trunc_ground ( p ) hp = _gf_gcd ( fp , gp , p ) deghp = hp . degree ( ) return deghp
compute an upper bound for the degree of the gcd of two univariate integer polynomials f and g .