(p, x, prec)
return _series_inversion1(p, x, prec)
multivariate series inversion ``1/p`` modulo ``O(x**prec)``

    Examples
    ========

    >>> from sympy.polys.domains import QQ
    >>> from sympy.polys.rings import ring
    >>> from sympy.polys.ring_series import rs_series_inversion
    >>> R, x, y = ring('x, y', QQ)
    >>> rs_series_inversion(1 + x*y**2, x, 4)
    -x**3*y**6 + x**2*y**4 - x*y**2 + 1
    >>> rs_series_inversion(1 + x*y**2, y, 4)
    -x*y**2 + 1
multivariate series inversion ``1/p`` modulo ``O(x**prec)``
multivariate series inversion 1 / p modulo O ( x ** prec )
def rs_series_inversion(p, x, prec):
    """
    multivariate series inversion ``1/p`` modulo ``O(x**prec)``

    Examples
    ========

    >>> from sympy.polys.domains import QQ
    >>> from sympy.polys.rings import ring
    >>> from sympy.polys.ring_series import rs_series_inversion
    >>> R, x, y = ring('x, y', QQ)
    >>> rs_series_inversion(1 + x*y**2, x, 4)
    -x**3*y**6 + x**2*y**4 - x*y**2 + 1
    >>> rs_series_inversion(1 + x*y**2, y, 4)
    -x*y**2 + 1
    """
    ring = p.ring
    zm = ring.zero_monom
    ii = ring.gens.index(x)
    m = min(p, key=lambda k: k[ii])[ii]
    if m:
        raise NotImplementedError('no constant term in series')
    if zm not in p:
        raise NotImplementedError('no constant term in series')
    if _has_constant_term(p - p[zm], x):
        raise NotImplementedError('p - p[0] must not have a constant term in the series variables')
    return _series_inversion1(p, x, prec)
def rs_series_inversion ( p , x , prec ) : ring = p . ring zm = ring . zero_monom ii = ring . gens . index ( x ) m = min ( p , key = lambda k : k [ ii ] ) [ ii ] if m : raise NotImplementedError ( 'no constant term in series' ) if zm not in p : raise NotImplementedError ( 'no constant term in series' ) if _has_constant_term ( p - p [ zm ] , x ) : raise NotImplementedError ( 'p - p[0] must not have a constant term in the series variables' ) return _series_inversion1 ( p , x , prec )