On Feb 9, 5:30 pm, rjf <[email protected]> wrote:
> On Feb 9, 7:19 am, kcrisman <[email protected]> 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.
>

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?

> 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

Certainly, although in this case the symbolic answer is well-known.

> 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.

Yes, this was a sarcastic comment by the original poster in that Trac
ticket, I believe.  Sorry for any confusion.

- kcrisman

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

Reply via email to