(exprs, gen, assume=True, relational=True)
return result
Reduce a system of rational inequalities with rational coefficients.

    Examples
    ========

    >>> from sympy import Poly, Symbol
    >>> from sympy.solvers.inequalities import reduce_rational_inequalities

    >>> x = Symbol('x', real=True)

    >>> reduce_rational_inequalities([[x**2 <= 0]], x)
    x == 0

    >>> reduce_rational_inequalities([[x + 2 > 0]], x)
    x > -2
    >>> reduce_rational_inequalities([[(x + 2, ">")]], x)
    x > -2
    >>> reduce_rational_inequalities([[x + 2]], x)
    x == -2
Reduce a system of rational inequalities with rational coefficients.
Reduce a system of rational inequalities with rational coefficients .
def reduce_rational_inequalities(exprs, gen, assume=True, relational=True):
    """Reduce a system of rational inequalities with rational coefficients.

    Examples
    ========

    >>> from sympy import Poly, Symbol
    >>> from sympy.solvers.inequalities import reduce_rational_inequalities

    >>> x = Symbol('x', real=True)

    >>> reduce_rational_inequalities([[x**2 <= 0]], x)
    x == 0

    >>> reduce_rational_inequalities([[x + 2 > 0]], x)
    x > -2
    >>> reduce_rational_inequalities([[(x + 2, ">")]], x)
    x > -2
    >>> reduce_rational_inequalities([[x + 2]], x)
    x == -2
    """
    exact = True
    eqs = []

    for _exprs in exprs:
        _eqs = []

        for expr in _exprs:
            if isinstance(expr, tuple):
                expr, rel = expr
            else:
                if expr.is_Relational:
                    expr, rel = expr.lhs - expr.rhs, expr.rel_op
                else:
                    expr, rel = expr, '=='

            try:
                (numer, denom), opt = parallel_poly_from_expr(
                    expr.together().as_numer_denom(), gen)
            except PolynomialError:
                raise PolynomialError("only polynomials and "
                    "rational functions are supported in this context")

            if not opt.domain.is_Exact:
                numer, denom, exact = numer.to_exact(), denom.to_exact(), False

            domain = opt.domain.get_exact()

            if not (domain.is_ZZ or domain.is_QQ):
                raise NotImplementedError(
                    "inequality solving is not supported over %s" % opt.domain)

            _eqs.append(((numer, denom), rel))

        eqs.append(_eqs)

    solution = solve_rational_inequalities(eqs)

    if not exact:
        solution = solution.evalf()

    if not relational:
        return solution

    real = ask(Q.real(gen), assumptions=assume)

    if not real:
        result = And(solution.as_relational(re(gen)), Eq(im(gen), 0))
    else:
        result = solution.as_relational(gen)

    return result
def reduce_rational_inequalities ( exprs , gen , assume = True , relational = True ) : exact = True eqs = [ ] for _exprs in exprs : _eqs = [ ] for expr in _exprs : if isinstance ( expr , tuple ) : expr , rel = expr else : if expr . is_Relational : expr , rel = expr . lhs - expr . rhs , expr . rel_op else : expr , rel = expr , '==' try : ( numer , denom ) , opt = parallel_poly_from_expr ( expr . together ( ) . as_numer_denom ( ) , gen ) except PolynomialError : raise PolynomialError ( "only polynomials and " "rational functions are supported in this context" ) if not opt . domain . is_Exact : numer , denom , exact = numer . to_exact ( ) , denom . to_exact ( ) , False domain = opt . domain . get_exact ( ) if not ( domain . is_ZZ or domain . is_QQ ) : raise NotImplementedError ( "inequality solving is not supported over %s" % opt . domain ) _eqs . append ( ( ( numer , denom ) , rel ) ) eqs . append ( _eqs ) solution = solve_rational_inequalities ( eqs ) if not exact : solution = solution . evalf ( ) if not relational : return solution real = ask ( Q . real ( gen ) , assumptions = assume ) if not real : result = And ( solution . as_relational ( re ( gen ) ) , Eq ( im ( gen ) , 0 ) ) else : result = solution . as_relational ( gen ) return result