def dmp_ground_extract(f, g, u, K):
 fc = dmp_ground_content(f, u, K)
 gc = dmp_ground_content(g, u, K)
 gcd = K.gcd(fc, gc)
 if (not K.is_one(gcd)):
  f = dmp_quo_ground(f, gcd, u, K)
  g = dmp_quo_ground(g, gcd, u, K)
 return (gcd, f, g)

def dmp_ground_extract ( f , g , u , K ) : fc = dmp_ground_content ( f , u , K ) gc = dmp_ground_content ( g , u , K ) gcd = K . gcd ( fc , gc ) if ( not K . is_one ( gcd ) ) : f = dmp_quo_ground ( f , gcd , u , K ) g = dmp_quo_ground ( g , gcd , u , K ) return ( gcd , f , g )
extract common content from a pair of polynomials in k[x] .