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
Fix sign of symbolic product product(1 - q^k, k, 1, N) #30520
Comments
comment:1
FWIW, Sympy doesn't seem to be able to pull this one:
Mathematica isn't more helpful:
Giac's answer can't be believed :
HTH, but doubting it... |
comment:2
for what it's worth, it's either in the interface to maxima in
I couldn't reproduce this on pure maxima, but I have never used it before, so it may well be there. EDIT: it may also be in the final conversion |
comment:3
A simple case
|
comment:4
This seems to happen in
and after:
|
This comment has been minimized.
This comment has been minimized.
comment:6
Any insights from Maxima or Sage symbolics experts? |
comment:7
Hi, thanks for the Maxima problem report. I was unable to reproduce this in Maxima 5.44.0/SBCL 2.0.0/Windows 10. Could you please report the details necessary to reproduce the problem:
|
Changed keywords from none to maxima |
comment:8
Apologies for cc-ing you. Rather than in Maxima, In Sage, the bug can lead to wrong results as in
or cause an error to be raised as in
Not sure what exactly gets sent to Maxima in those cases. I have Maxima 5.44.0, ECL 21.2.1, macOS 10.14.6.
Sage calls Maxima with the following global settings:
"Before this ticket" is the observed bug. |
comment:9
Here:
which is presumably in the contributed
No. |
comment:10
I can't be sure about what's going on here, but I speculate the error is coming out of
The leading term is off by 1 (right?) -- I think this is the origin of the stray -1 which was observed. |
This comment has been minimized.
This comment has been minimized.
comment:11
Thanks for the rephrasing suggestion and your thoughts on the problem. |
comment:12
@robert-dodier: Yes, I think you are right. In line 1112 of the file suggested by kcrisman, the code for
If I understand correctly, then this is an off-by-one error: the number of terms in the product is |
comment:13
I located the copy of that file in my Sage installation:
and changed line 1112 as suggested by Dave. Now I get the correct product from the ticket description:
and for the sum of
but this still gives trouble:
It would be nice to fix that too. |
comment:14
I've come to the same conclusion. I think this patch fixes it:
Although the existing, incorrect code is exercised by the unit tests (rtest_simplify_sum and rtest_solve_rec), fixing it does not change any results! Not sure what's going on there; I guess it is a happy accident. Or not. Anyway I will add a few unit tests and commit the patch. |
This comment has been minimized.
This comment has been minimized.
comment:15
Replying to @slel:
Well, that's a different bug, although it's in the same file; looks like it is in the stanza which begins |
comment:16
Replying to @robert-dodier:
You are right. This is now tracked at #31557. |
comment:17
Fixed (to the best of my knowledge; no doubt you'll want to verify for Sage) by commit 762fd85 on maxima-code/master which applies the patch for simplify_product shown above. |
comment:18
Thanks! |
comment:19
Should we apply the upstream commit fixing this |
This comment has been minimized.
This comment has been minimized.
comment:20
Replying to @slel:
For what it's worth, a new Maxima version is on the horizon; it is being discussed on the mailing list, although no work on it has been announced. So my guess is that a new version will appear in, let's say, one to three months. I don't know whether that implies you should wait or not. |
comment:21
Moving to 9.4, as 9.3 has been released. |
Branch: public/30520 |
Commit: |
Author: Dave Morris |
comment:23
This was fixed in maxima 5.45. Ticket #31876 did the upgrade in sage. The PR just adds a doctest. |
Reviewer: Samuel Lelièvre |
comment:24
Lovely. |
Changed branch from public/30520 to |
Reported at Ask Sage question 53345.
The output for this product
has an incorrect leading minus sign:
Expected:
Fixed in Maxima by this commit:
CC: @DaveWitteMorris @macrakis @robert-dodier @kcrisman @nbruin @slel
Component: symbolics
Keywords: maxima
Author: Dave Morris
Branch/Commit:
69c0235
Reviewer: Samuel Lelièvre
Issue created by migration from https://trac.sagemath.org/ticket/30520
The text was updated successfully, but these errors were encountered: