On Oct 2, 5:32 pm, Fredrik Johansson <fredrik.johans...@gmail.com>
wrote:
> On Sat, Oct 3, 2009 at 12:58 AM, rjf <fate...@gmail.com> wrote:
>
> > Reading the bug report it seemed to me that the code was determining
> > in some way that terms could be dropped off the sum because they were
> > too small to contribute, and then
> > stopped adding them in. Is that the "simple implementation bug"? Or is
> > that an additional bad idea?
>
> The summation code basically adds terms that are close together
> exactly (using a big integer mantissa) and discards terms that are
> much smaller. If the first pass over the terms results in a large
> cancellation, the summation is restarted at higher precision and
> eventually (if necessary) the smaller terms will be included as well.

Is this better than compensated summation?  Is it better than taking
those
discarded smaller terms and adding them together separately?
Is this just copied from MPFR?  Did they have an analysis of why this
is
a good idea?
It may be a good idea if comparison of 2 numbers is very very much
cheaper than addition of 2 numbers, and checking for cancellation is
cheap.  I didn't notice any
reference to the literature in the file I looked at, but maybe I
wasn't looking
in the right place.

>
> The bug was due to a basic, dumb error in the formula used to
> determine "much smaller", and the reason the bug wasn't detected
> before by any tests is that it only triggered in some cases (indeed,
> in a platform dependent way) and with precisions or numbers around 40
> digits or larger.

That's unfortunate.  It would still be nice to know that the algorithm
used
has been shown to be a good one, and perhaps has been compared to
others --- since there has been an extensive discussion of algorithms
that are (within their own constraints) known to be quite good.

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