On Feb 9, 7:19 am, kcrisman <kcris...@gmail.com> wrote:

> ... snip...
>
> As far as I understand it, using keepfloat:true is an attempt to keep
> things *more* exact, not less.  From Ticket #2400:
> +++++++
> sage: f = e^(-x^2)
> sage: f.integrate(x, 0, 0.1)
> 2066*sqrt(pi)/36741
> sage: f.integrate(x, 0, 1/10)
> sqrt(pi)*erf(1/10)/2
>
> Hmmmm. Does this mean erf(1/10) is a rational number?

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.

Once 0.1 is converted to a nearby rational, everything should be done
in rational arithmetic if possible.

 Conflating symbolic algebraic anti-differentiation and approximating
the area under a curve by application of (whatever... the "fundamental
theorem of integral calculus"?)  is potentially
hazardous, especially  if you start with numbers like 0.1, which could
be exactly 1/10, but could also be
some nearby binary number.

It would, of course, be highly unlikely for erf(1/10 )   or erf(0.1e0)
or erf(0.1d0)  to be rational.
RJF

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to