[Numpy-discussion] Bug in logaddexp2.reduce

Charles R Harris charlesr.harris@gmail....
Wed Mar 31 15:21:41 CDT 2010


On Wed, Mar 31, 2010 at 11:38 AM, T J <tjhnson@gmail.com> wrote:

> On Wed, Mar 31, 2010 at 10:30 AM, T J <tjhnson@gmail.com> wrote:
> > Hi,
> >
> > I'm getting some strange behavior with logaddexp2.reduce:
> >
> > from itertools import permutations
> > import numpy as np
> > x = np.array([-53.584962500721154, -1.5849625007211563,
> -0.5849625007211563])
> > for p in permutations([0,1,2]):
> >    print p, np.logaddexp2.reduce(x[list(p)])
> >
> > Essentially, the result depends on the order of the array...and we get
> > nans in the "bad" orders.  Likely, this also affects logaddexp.
> >
>
> Sorry, forgot version information:
>
> $ python -c "import numpy;print numpy.__version__"
> 1.5.0.dev8106
> __
>

Looks like roundoff error.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20100331/f5ed5ff1/attachment.html 


More information about the NumPy-Discussion mailing list