(ie, s, assume=True)
A hacky replacement for solve, since the latter only works for
        univariate inequalities.
A hacky replacement for solve, since the latter only works for
        univariate inequalities.
A hacky replacement for solve since the latter only works for univariate inequalities .
def _solve_inequality(ie, s, assume=True):
    """ A hacky replacement for solve, since the latter only works for
        univariate inequalities. """
    if not ie.rel_op in ('>', '>=', '<', '<='):
        raise NotImplementedError
    expr = ie.lhs - ie.rhs
    try:
        p = Poly(expr, s)
        if p.degree() != 1:
            raise NotImplementedError
    except (PolynomialError, NotImplementedError):
        try:
            n, d = expr.as_numer_denom()
            return reduce_rational_inequalities([[ie]], s, assume=assume)
        except PolynomialError:
            return solve_univariate_inequality(ie, s, assume=assume)
    a, b = p.all_coeffs()
    if a.is_positive:
        return ie.func(s, -b/a)
    elif a.is_negative:
        return ie.func(-b/a, s)
    else:
        raise NotImplementedError
def _solve_inequality ( ie , s , assume = True ) : if not ie . rel_op in ( '>' , '>=' , '<' , '<=' ) : raise NotImplementedError expr = ie . lhs - ie . rhs try : p = Poly ( expr , s ) if p . degree ( ) != 1 : raise NotImplementedError except ( PolynomialError , NotImplementedError ) : try : n , d = expr . as_numer_denom ( ) return reduce_rational_inequalities ( [ [ ie ] ] , s , assume = assume ) except PolynomialError : return solve_univariate_inequality ( ie , s , assume = assume ) a , b = p . all_coeffs ( ) if a . is_positive : return ie . func ( s , - b / a ) elif a . is_negative : return ie . func ( - b / a , s ) else : raise NotImplementedError