Skip to content
New issue

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

Wrong result for a limit #25885

Closed
ytxytx opened this issue Nov 8, 2023 · 1 comment · Fixed by #25893
Closed

Wrong result for a limit #25885

ytxytx opened this issue Nov 8, 2023 · 1 comment · Fixed by #25893
Labels

Comments

@ytxytx
Copy link

ytxytx commented Nov 8, 2023

I tried out a calculus exercise on SymPy and surprisingly it just failed to give the right answer, rather than timed out or throw an exception.
The problem is a bit confusing for human, though. But there must be something wrong that caused this fault.

In [2]: x = symbols('x', real = True)
In [3]: expr = (1+1/x)**(x**2)/exp(x)
In [4]: limit(expr, x, oo)
Out[4]: 1

The correct answer is exp(-1/2).

skirpichev added a commit to skirpichev/diofant that referenced this issue Nov 9, 2023
@smichr
Copy link
Member

smichr commented Nov 9, 2023

this is different than #24210

>>> eq = exp(x)/(1+1/x)**(x**2)
>>> limit(eq,x,oo)
exp(1/2)
>>> limit(1/eq,x,oo)
1

skirpichev added a commit to skirpichev/diofant that referenced this issue Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants