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

Maxima limit() regression #17709

Open
rwst opened this issue Feb 1, 2015 · 18 comments
Open

Maxima limit() regression #17709

rwst opened this issue Feb 1, 2015 · 18 comments

Comments

@rwst
Copy link

rwst commented Feb 1, 2015

var('n'); u = (1+sqrt(n))^(-n); limit(u(n=n+1)/u,n=infinity): this was reported in http://ask.sagemath.org/question/25647/cannot-calculate-limit/ and worked at least in Sage-4.7

Upstream: Reported upstream. Developers acknowledge bug.

CC: @sagetrac-tmonteil

Component: calculus

Keywords: limit

Issue created by migration from https://trac.sagemath.org/ticket/17709

@rwst rwst added this to the sage-6.5 milestone Feb 1, 2015
@kcrisman
Copy link
Member

kcrisman commented Feb 3, 2015

comment:1

Upstream here.

@kcrisman
Copy link
Member

kcrisman commented Feb 3, 2015

Upstream: Reported upstream. No feedback yet.

@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 29, 2020

comment:2

Seems fixed in 9.2.beta10 - 0 is returned

@mkoeppe mkoeppe removed this from the sage-6.5 milestone Aug 29, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented Aug 29, 2020

comment:3

(The upstream bug in maxima is still present; it seems we are using something else for computing the limit.)

@kcrisman
Copy link
Member

comment:4

My guess is that we now, as with integration, go through several "algorithms"/programs to get limits.

I guess technically this is still a Sage bug, then, if that is true and one then specifies the algorithm? Otherwise I'd at the very least add a doctest.

@fchapoton
Copy link
Contributor

Changed keywords from none to limit

@fchapoton
Copy link
Contributor

comment:6

Replying to @kcrisman:

My guess is that we now, as with integration, go through several "algorithms"/programs to get limits.

Not yet, as nobody did it..

I guess technically this is still a Sage bug, then, if that is true and one then specifies the algorithm? Otherwise I'd at the very least add a doctest.

@kcrisman
Copy link
Member

comment:7

Hmm, that is interesting. Maxima returns a nounform 'limit((sqrt(n)+1)<sup>n*(sqrt(n+1)+1)</sup>((-n)-1),n,inf) inside of Sage 9.2.beta1

Maxima 5.42.2 http://maxima.sourceforge.net
using Lisp ECL 16.1.2

But I don't have the most recent Maxima. Can you test this?

sage -maxima
<messages about Maxima 5.44, hopefully>
(%i1) limit((1+sqrt(n+1))^(-n-1)/(1+sqrt(n))^(-n),n,inf);

If you get zero then they fixed it, and then a doctest suffices. Otherwise we may have something really weird going on in our own processing, though I don't see what would have changed - Frédéric is right about that, as far as I can tell.

@kcrisman
Copy link
Member

comment:8

Can you also test this in maxima_calculus in the most recent Sage rc? Upstream says it is not fixed. I still get

sage: maxima_calculus("limit((1+sqrt(n+1))^(-n-1)/(1+sqrt(n))^(-n),n,inf)")
'limit((sqrt(n)+1)^n*(sqrt(n+1)+1)^((-n)-1),n,inf)

@fchapoton
Copy link
Contributor

comment:9

I get

sage: banner()                                                                  
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 9.2.rc2, Release Date: 2020-10-12                 │
│ Using Python 3.8.5. Type "help()" for help.                        │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable.     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
sage: maxima_calculus("limit((1+sqrt(n+1))^(-n-1)/(1+sqrt(n))^(-n),n,inf)")     
'limit((sqrt(n)+1)^n*(sqrt(n+1)+1)^((-n)-1),n,inf)

EDIT:
with

Maxima 5.44.0 http://maxima.sourceforge.net
using Lisp ECL 20.4.24

@kcrisman
Copy link
Member

comment:10

That is really weird. I really can't find any branch of the code that should just avoid Maxima completely without adding an algorithm. Can you confirm Matthias' contention that

var('n'); u = (1+sqrt(n))^(-n); limit(u(n=n+1)/u,n=infinity)

now returns zero in that rc version?

@fchapoton
Copy link
Contributor

comment:11

no, this does not return 0. Maybe Matthias was looking at something else ?

@mkoeppe
Copy link
Contributor

mkoeppe commented Oct 13, 2020

comment:12

I cannot confirm my claim from comment 2 above either. I don't know what I may have tested there.

@kcrisman
Copy link
Member

comment:13

Ok, thanks - setting back settings then. At least now Maxima has acknowledged bug :-)

@kcrisman
Copy link
Member

Changed upstream from Reported upstream. No feedback yet. to Reported upstream. Developers acknowledge bug.

@kcrisman kcrisman added this to the sage-9.3 milestone Oct 13, 2020
@mkoeppe
Copy link
Contributor

mkoeppe commented Feb 13, 2021

comment:14

Setting new milestone based on a cursory review of ticket status, priority, and last modification date.

@mkoeppe mkoeppe modified the milestones: sage-9.3, sage-9.4 Feb 13, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.4, sage-9.5 Aug 22, 2021
@mkoeppe mkoeppe removed this from the sage-9.5 milestone Dec 18, 2021
@mkoeppe mkoeppe added this to the sage-9.6 milestone Dec 18, 2021
@mkoeppe mkoeppe modified the milestones: sage-9.6, sage-9.7 May 3, 2022
@fchapoton
Copy link
Contributor

comment:18

in 9.7.b1

sage: limit(u(n=n+1)/u,n=infinity,algorithm="sympy")
0
sage: limit(u(n=n+1)/u,n=infinity,algorithm="fricas")
0
sage: limit(u(n=n+1)/u,n=infinity,algorithm="giac")
// Giac share root-directory:/home/chapoton/sage/local/share/giac/
// Giac share root-directory:/home/chapoton/sage/local/share/giac/
Help file /home/chapoton/sage/local/share/giac/doc/fr/aide_cas not found
Added 0 synonyms
0
sage: limit(u(n=n+1)/u,n=infinity,algorithm="maxima")
limit((sqrt(n + 1) + 1)^(-n - 1)*(sqrt(n) + 1)^n, n, +Infinity)

@mkoeppe mkoeppe modified the milestones: sage-9.7, sage-9.8 Sep 19, 2022
@mkoeppe mkoeppe removed this from the sage-9.8 milestone Jan 29, 2023
@kcrisman
Copy link
Member

For what it's worth, apparently this is fixed upstream in 5.47. Assuming this is true and that we have that version, adding some tests to confirm it against regressions would be all we need here, right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants