Sage: Ticket #12152: Maxima fails to properly convert some floats to rationals
https://trac.sagemath.org/ticket/12152
<p>
From <a class="ext-link" href="https://groups.google.com/d/topic/sage-devel/JZ54xk51F-E/discussion"><span class="icon"></span>https://groups.google.com/d/topic/sage-devel/JZ54xk51F-E/discussion</a> :
</p>
<pre class="wiki">sage: a, b, t = var('a b t')
sage: f(a,b,t) = sin(t)^2/(a + b*cos(t))^2
sage: integrate(f(3/2,1,t), (t,0,2*pi))
-2/5*(sqrt(5) - 3)*pi*sqrt(5)
</pre><p>
Works properly, but:
</p>
<pre class="wiki">sage: integrate(f(1.5,1,t), (t,0,2*pi))
</pre><p>
blows up with
</p>
<pre class="wiki">RuntimeError: ECL says: Error executing code in Maxima: CRECIP:
attempted inverse of zero (mod 3)
</pre><p>
From the discussion there, this seems to be related to Maxima's attempts to convert floats to rationals, and that Sage turns off such conversion with <code>keepfloat:true</code>.
</p>
en-usSagehttps://trac.sagemath.org/chrome/site/logo_sagemath_trac.png
https://trac.sagemath.org/ticket/12152
Trac 1.1.6kcrismanWed, 14 Dec 2011 02:39:54 GMT
https://trac.sagemath.org/ticket/12152#comment:1
https://trac.sagemath.org/ticket/12152#comment:1
<p>
See the thread above for some additional discussion, in particular about whether to not consider this a bug, and whether one should just disallow integrals with decimal points.
</p>
TicketkcrismanThu, 29 Nov 2012 15:40:49 GMTupstream changed
https://trac.sagemath.org/ticket/12152#comment:2
https://trac.sagemath.org/ticket/12152#comment:2
<ul>
<li><strong>upstream</strong>
changed from <em>N/A</em> to <em>Reported upstream. No feedback yet.</em>
</li>
</ul>
<p>
Here we go - another such report.
</p>
<pre class="wiki">
(%i1) keepfloat:true;
(%o1) true
(%i2) integrate(exp(-5.3*x),x,0,1);
Maxima encountered a Lisp error:
Argument V is not a INTEGER: 1.0
Automatically continuing.
</pre><p>
Based on <a class="ext-link" href="http://ask.sagemath.org/question/2028/def-fx-evaluvates-individually-but-not-inside-plot"><span class="icon"></span>this ask.sagemath.org post</a>.
</p>
<p>
I've reported several similar things upstream at <a class="ext-link" href="https://sourceforge.net/p/maxima/bugs/2510/"><span class="icon"></span>this Maxima bug</a>.
</p>
TicketkcrismanThu, 29 Nov 2012 16:41:14 GMT
https://trac.sagemath.org/ticket/12152#comment:3
https://trac.sagemath.org/ticket/12152#comment:3
<p>
Interestingly, we never considered the following from an old sage-devel conversation.
</p>
<pre class="wiki">No, it means that you have not noticed the value set for ratepsilon,
which governs the tolerance
for conversion of floats to rationals. It is by default set to
2.0e-8, presumably for "single float"
systems. It should probably be set to something more like 10e-16 for
double float systems.
Ah, that is very helpful. In this case the numerical approximations
do indeed agree up to the output of n(). Perhaps we could potentially
go back to keepfloat:false but with whatever the standard precision in
Sage would equate to - Jason, would that help things with matrices?
</pre><p>
This would probably keep a lot of problems away, especially since, as Nils says elsewhere, floats and symbolic integrals don't really mix.
</p>
<p>
Anyway, see also <a class="ext-link" href="https://sourceforge.net/p/maxima/bugs/2510/#fd1d"><span class="icon"></span>https://sourceforge.net/p/maxima/bugs/2510/#fd1d</a>
</p>
TicketjdemeyerTue, 13 Aug 2013 15:35:53 GMTmilestone changed
https://trac.sagemath.org/ticket/12152#comment:4
https://trac.sagemath.org/ticket/12152#comment:4
<ul>
<li><strong>milestone</strong>
changed from <em>sage-5.11</em> to <em>sage-5.12</em>
</li>
</ul>
Ticketvbraun_spamThu, 30 Jan 2014 21:20:52 GMTmilestone changed
https://trac.sagemath.org/ticket/12152#comment:5
https://trac.sagemath.org/ticket/12152#comment:5
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.1</em> to <em>sage-6.2</em>
</li>
</ul>
Ticketvbraun_spamTue, 06 May 2014 15:20:58 GMTmilestone changed
https://trac.sagemath.org/ticket/12152#comment:6
https://trac.sagemath.org/ticket/12152#comment:6
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.2</em> to <em>sage-6.3</em>
</li>
</ul>
Ticketvbraun_spamSun, 10 Aug 2014 16:51:03 GMTmilestone changed
https://trac.sagemath.org/ticket/12152#comment:7
https://trac.sagemath.org/ticket/12152#comment:7
<ul>
<li><strong>milestone</strong>
changed from <em>sage-6.3</em> to <em>sage-6.4</em>
</li>
</ul>
Ticket