# sympy/sympy

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

# solving inequality involving exp fails for large values #10268

Closed
opened this Issue Dec 16, 2015 · 3 comments

## Comments

Projects
None yet
3 participants
Member

### smichr commented Dec 16, 2015

 ```>>> solve(log(x)<100) And(-oo < x, x < exp(100)) >>> solve(log(x)<1000) False```
Contributor

### darkcoderrises commented Dec 16, 2015

 It breaks on `solve(log(x)<250)` I pinpointed the difference between `solve(log(x)<250)` and `solve(log(x)<249)`, to the following function. https://github.com/sympy/sympy/blob/master/sympy/solvers/inequalities.py#L427. This function when called with exp(250)-1 returns false, but with exp(249) -1 return true. Which then does not allow https://github.com/sympy/sympy/blob/master/sympy/solvers/inequalities.py#L457 to insert the solution
Contributor

### megh1241 commented Dec 16, 2015

 I would like to add one more thing to that. The return value of ' v = e.subs(gen, x)' in https://github.com/sympy/sympy/blob/master/sympy/solvers/inequalities.py#L428. is different in both the cases. In the case of solve( log (x) < 100), some of the assumptions of v such as 'is_negative', 'is_nonnegative' have true/false values. However, in the case of solve(log(x) < 1000), these assumptions are of type None. The function https://github.com/sympy/sympy/blob/master/sympy/solvers/inequalities.py#L430 will eventually call https://github.com/sympy/sympy/blob/master/sympy/core/expr.py#L290. The line here which seems to be different for both the cases is this if condition: https://github.com/sympy/sympy/blob/master/sympy/core/expr.py#L304 The assumptions of 'dif' here depend on the assumptions of v, and in the case of solve(log(x) < 1000), these are of type None, so it enters the 'else' block even though it should satisfy the 'if' condition.

### skirpichev added a commit to diofant/diofant that referenced this issue Dec 16, 2015

``` Fix precision issues in Rel._eval_simplify ```
`Closes sympy/sympy#10268`
``` 0bb3f83 ```

Merged

Member

### smichr commented Dec 19, 2015

 @meghana1995, thanks for your input. This is now resolved.

### smichr closed this Dec 19, 2015

to join this conversation on GitHub. Already have an account? Sign in to comment