-
-
Notifications
You must be signed in to change notification settings - Fork 488
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
Integrating the sgn() function can produce incorrect results #11590
Comments
comment:2
This appears to be in Maxima, and is reported at their bug tracker.
|
Upstream: Reported upstream. Little or no feedback. |
comment:3
Even with #11483, this isn't working right. It should, though - see Barton's post at the Maxima ticket:
so I'm not sure why this is still returning the "wrong" thing. Probably something about the integration code... |
Changed upstream from Reported upstream. Little or no feedback. to Reported upstream. Developers acknowledge bug. |
comment:4
I'm stumped on this one. We get the correct antiderivative:
And ECL gives us the right answer, so it's not an environment setting:
But going through
|
comment:5
Well, I'm glad it wasn't just me! Could it be that because we get an answer without |
comment:6
Replying to @kcrisman:
It's possible. The abs_integrate code looks like it defines extra definite integration methods, and then loops through them until |
comment:7
Something else is weird here. In standalone maxima-5.26, we don't get back the wrong answer. But through sage, without abs_integrate, we get
Intriguing! |
comment:8
Some random observations that may or may not be relevant. First, let's separate the "Reader" (parser) and the "Evaluator".
Note the subtle difference between
to Slightly less likely to make a difference: If you look at the full expression resulting for
|
comment:9
I took a much stupider approach, but I did essentially try replacing If I replace I guess the Right Thing to do would be to go read the maxima source... |
comment:10
Replying to @orlitzky:
Yes, that would make things much worse (not to mention a major step back in other ways). The
should work and compares nicely to the pexpect-based
You should really try the commands I suggested earlier to see where the problem is, though (no changes to the source required!). I don't have ready access to a sage build with the right patches, but you obviously do. Even on a clearly insufficiently patched sage I observe different behaviour:
|
comment:11
Sorry, I should have been more clear: I did try everything you suggested. Replacing Here's a session with just the abs_integrate patch applied, maxima-5.26. I left the error at the top intact, for whatever reason it doesn't work at all until after I've integrated something.
And here's a session with
The same thing, except the original integration actually works. Problem is, other tests start to fail with
|
comment:12
Replying to @orlitzky:
This doesn't load maxima inside ecl yet, but once you evaluate an integral, maxima is loaded and the |
comment:13
Replying to @kcrisman:
Did you try it with If maxima's position is that we should use a different integration routine (i.e., |
comment:14
Note that this was just Barton Willis (Maxima dev) example.
I don't think they claimed it was fixed.
Yes, I am a little stumped on this. I thought that the apostrophe just meant "don't evaluate nounform", but apparently I was mistaken. I just reported this example on the Maxima ticket, but I wouldn't hold my breath waiting for it, since there is a way to get it to work correctly there. |
Stopgaps: #12731 |
comment:16
See also #12731. |
Changed stopgaps from #12731 to none |
Stopgaps: #12731 |
comment:18
FYI fixed in Maxima by commit 5a300aa, which I have cherry-picked to branch-5_38. Related bug reports: |
Changed upstream from Reported upstream. Developers acknowledge bug. to Fixed upstream, in a later stable release. |
comment:20
This now works in 8.9.b7. We need to add the doctest
|
Branch: u/mjo/ticket/11590 |
New commits:
|
Commit: |
Author: Michael Orlitzky |
Reviewer: Frédéric Chapoton |
comment:22
ok, this is now handled by giac.. |
Changed branch from u/mjo/ticket/11590 to |
Actual result:
Since the argument to sgn() has only one root, -1/2, on (-1, 0), there are only two subintervals on which sgn() can have different values. In particular,
Now, the original, actual result should be equivalent to the sum of the following:
So, something went wrong during the initial integration.
Upstream: Fixed upstream, in a later stable release.
CC: @nbruin @fchapoton
Component: calculus
Stopgaps: #12731
Author: Michael Orlitzky
Branch/Commit:
bf1b50b
Reviewer: Frédéric Chapoton
Issue created by migration from https://trac.sagemath.org/ticket/11590
The text was updated successfully, but these errors were encountered: