(f, g)
Half extended Euclidean algorithm, if univariate.
Half extended Euclidean algorithm, if univariate.
Half extended Euclidean algorithm if univariate .
def half_gcdex(f, g):
        """Half extended Euclidean algorithm, if univariate. """
        lev, dom, per, F, G = f.unify(g)

        if not lev:
            s, h = dup_half_gcdex(F, G, dom)
            return per(s), per(h)
        else:
            raise ValueError('univariate polynomial expected')
def half_gcdex ( f , g ) : lev , dom , per , F , G = f . unify ( g ) if not lev : s , h = dup_half_gcdex ( F , G , dom ) return per ( s ) , per ( h ) else : raise ValueError ( 'univariate polynomial expected' )