@public
def half_gcdex(f, g, *gens, **args):
 options.allowed_flags(args, ['auto', 'polys'])
 try:
  ((F, G), opt) = parallel_poly_from_expr((f, g), *gens, **args)
 except PolificationFailed as exc:
  (domain, (a, b)) = construct_domain(exc.exprs)
  try:
   (s, h) = domain.half_gcdex(a, b)
  except NotImplementedError:
   raise ComputationFailed('half_gcdex', 2, exc)
  else:
   return (domain.to_sympy(s), domain.to_sympy(h))
 (s, h) = F.half_gcdex(G, auto=opt.auto)
 if (not opt.polys):
  return (s.as_expr(), h.as_expr())
 else:
  return (s, h)

@ public def half_gcdex ( f , g , * gens , ** args ) : options . allowed_flags ( args , [ 'auto' , 'polys' ] ) try : ( ( F , G ) , opt ) = parallel_poly_from_expr ( ( f , g ) , * gens , ** args ) except PolificationFailed as exc : ( domain , ( a , b ) ) = construct_domain ( exc . exprs ) try : ( s , h ) = domain . half_gcdex ( a , b ) except NotImplementedError : raise ComputationFailed ( 'half_gcdex' , 2 , exc ) else : return ( domain . to_sympy ( s ) , domain . to_sympy ( h ) ) ( s , h ) = F . half_gcdex ( G , auto = opt . auto ) if ( not opt . polys ) : return ( s . as_expr ( ) , h . as_expr ( ) ) else : return ( s , h )
half extended euclidean algorithm of f and g .