@public
def resultant(f, g, *gens, **args):
 includePRS = args.pop('includePRS', False)
 options.allowed_flags(args, ['polys'])
 try:
  ((F, G), opt) = parallel_poly_from_expr((f, g), *gens, **args)
 except PolificationFailed as exc:
  raise ComputationFailed('resultant', 2, exc)
 if includePRS:
  (result, R) = F.resultant(G, includePRS=includePRS)
 else:
  result = F.resultant(G)
 if (not opt.polys):
  if includePRS:
   return (result.as_expr(), [r.as_expr() for r in R])
  return result.as_expr()
 else:
  if includePRS:
   return (result, R)
  return result

@ public def resultant ( f , g , * gens , ** args ) : includePRS = args . pop ( 'includePRS' , False ) options . allowed_flags ( args , [ 'polys' ] ) try : ( ( F , G ) , opt ) = parallel_poly_from_expr ( ( f , g ) , * gens , ** args ) except PolificationFailed as exc : raise ComputationFailed ( 'resultant' , 2 , exc ) if includePRS : ( result , R ) = F . resultant ( G , includePRS = includePRS ) else : result = F . resultant ( G ) if ( not opt . polys ) : if includePRS : return ( result . as_expr ( ) , [ r . as_expr ( ) for r in R ] ) return result . as_expr ( ) else : if includePRS : return ( result , R ) return result
compute resultant of f and g .