def dup_primitive(f, K):
 if (not f):
  return (K.zero, f)
 cont = dup_content(f, K)
 if K.is_one(cont):
  return (cont, f)
 else:
  return (cont, dup_quo_ground(f, cont, K))

def dup_primitive ( f , K ) : if ( not f ) : return ( K . zero , f ) cont = dup_content ( f , K ) if K . is_one ( cont ) : return ( cont , f ) else : return ( cont , dup_quo_ground ( f , cont , K ) )
compute content and the primitive form of f in k[x] .