def dup_prs_resultant(f, g, K):
 if ((not f) or (not g)):
  return (K.zero, [])
 (R, S) = dup_inner_subresultants(f, g, K)
 if (dup_degree(R[(-1)]) > 0):
  return (K.zero, R)
 return (S[(-1)], R)

def dup_prs_resultant ( f , g , K ) : if ( ( not f ) or ( not g ) ) : return ( K . zero , [ ] ) ( R , S ) = dup_inner_subresultants ( f , g , K ) if ( dup_degree ( R [ ( - 1 ) ] ) > 0 ) : return ( K . zero , R ) return ( S [ ( - 1 ) ] , R )
resultant algorithm in k[x] using subresultant prs .