def dup_extract(f, g, K):
 fc = dup_content(f, K)
 gc = dup_content(g, K)
 gcd = K.gcd(fc, gc)
 if (not K.is_one(gcd)):
  f = dup_quo_ground(f, gcd, K)
  g = dup_quo_ground(g, gcd, K)
 return (gcd, f, g)

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