#11590: Integrating the sgn() function can produce incorrect results
------------------------+---------------------------------------------------
Reporter: mjo | Owner: burcin
Type: defect | Status: new
Priority: major | Milestone:
Component: calculus | Keywords:
Work_issues: | Upstream: Reported upstream. Developers
acknowledge bug.
Reviewer: | Author:
Merged: | Dependencies:
------------------------+---------------------------------------------------
Comment(by nbruin):
Replying to [comment:9 mjo]:
> I tried replacing the call to `maxima_eval` in `sr_integral` with a
simple string substitution. It causes more problems than it solves, I
think.
Yes, that would make things much worse (not to mention a major step back
in other ways). The `sr_integral` interface tries to avoid string-based
conversion, but maxima_lib in general is still capable of it in a much
better way than crafting your own string-mangling based on `#$...$`. For
instance:
{{{
sage.calculus.calculus.maxima(sage.calculus.calculus.dummy_integrate(x *
sgn(x^2 - 1/4), x, -1, 0))
}}}
should work and compares nicely to the pexpect-based
{{{
maxima(sage.calculus.calculus.dummy_integrate(x * sgn(x^2 - 1/4), x, -1,
0))
}}}
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:
{{{
sage: maxima_eval(I1)
<ECL: ((RAT SIMP) 1 2)>
sage: maxima_eval(I2)
RuntimeError: ECL says: Error executing code in Maxima: first: empty
argument.
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11590#comment:10>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.