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

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