#11164: Integral of sin(x)/x gives false result.
--------------------------+-------------------------------------------------
Reporter: benreynwar | Owner: burcin
Type: defect | Status: new
Priority: major | Milestone:
Component: calculus | Keywords:
Author: | Upstream: Fixed upstream, in a later stable
release.
Reviewer: | Merged:
Work_issues: |
--------------------------+-------------------------------------------------
Changes (by kcrisman):
* owner: tbd => burcin
* priority: minor => major
* component: PLEASE CHANGE => calculus
* upstream: N/A => Fixed upstream, in a later stable release.
Comment:
In the future, be sure to pick a component (for instance, calculus or
symbolics); that will help people find it more easily.
There are two problems here.
* The actual problem - the report unfortunately has a typo.
{{{
sage: integrate(eq,x,-1e-6,1e-6)
-3.14159065359
}}}
This is definitely a problem. However, it's fixed in the latest
Maxima. Here is the old one, in Sage:
{{{
Maxima 5.22.1 http://maxima.sourceforge.net
using Lisp ECL 10.4.1
<snip>
(%i2) keepfloat:true;
(%o2) true
(%i3) integrate(sin(x)/x,x,-1.00000000000000e-6,1.00000000000000e-6)
;
(%o3) - 3.141590653589793
}}}
And here is 5.24.0. I assume this isn't a problem of which Lisp we are
using?
{{{
Maxima 5.24.0 http://maxima.sourceforge.net
using Lisp SBCL 1.0.24
(%i3) keepfloat:true;
(%o3) true
(%i8) integrate(sin(x)/x,x,-1.00000000000000e-6,1.00000000000000e-6);
rat: replaced 9.999999999999999e-7 by 1/1000000 = 9.999999999999999e-7
rat: replaced -9.999999999999999e-7 by -1/1000000 = -9.999999999999999e-7
rat: replaced -9.999999999999999e-7 by -1/1000000 = -9.999999999999999e-7
rat: replaced 9.999999999999999e-7 by 1/1000000 = 9.999999999999999e-7
%i %i
(%o8) %i gamma_incomplete(0, - -------) - %i gamma_incomplete(0, -------)
1000000 1000000
}}}
* A problem revealed, but also fixed in the latest. Old:
{{{
(%i4) integrate(sin(x)/x,x,-1e-6,1e6);
Maxima encountered a Lisp error:
#<a FLOATING-POINT-OVERFLOW>
Automatically continuing.
To enable the Lisp debugger set *debugger-hook* to nil.
}}}
New:
{{{
(%i10) integrate(sin(x)/x,x,-1e-6,1e6);
rat: replaced 9.999999999999999e-7 by 1/1000000 = 9.999999999999999e-7
rat: replaced -9.999999999999999e-7 by -1/1000000 = -9.999999999999999e-7
rat: replaced -1000000.0 by -1000000/1 = -1000000.0
rat: replaced 1000000.0 by 1000000/1 = 1000000.0
%i
%i gamma_incomplete(0,
-------)
%i gamma_incomplete(0, 1000000 %i)
1000000
(%o10) - ---------------------------------- -
-------------------------------
2 2
%i
%i gamma_incomplete(0, - -------)
1000000 %i gamma_incomplete(0, -
1000000 %i)
+ --------------------------------- +
------------------------------------
2 2
}}}
We'd need doctesting to test both of these once we upgrade Maxima.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/11164#comment:1>
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.