[Numpy-discussion] Bug in logaddexp2.reduce

T J tjhnson at gmail.com
Wed Mar 31 18:51:15 EDT 2010

On Wed, Mar 31, 2010 at 3:38 PM, David Warde-Farley <dwf at cs.toronto.edu> wrote:
> Unfortunately there's no good way of getting around order-of-
> operations-related rounding error using the reduce() machinery, that I
> know of.

That seems reasonable, but receiving a nan, in this case, does not.
Are my expectations are unreasonable?

Would sorting the values before reducing be an ugly(-enough) solution?
 It seems to fix it in this particular case.  Or is the method you
posted in the link below a better solution?

> I'd like to see a 'logsumexp' and 'logsumexp2' in NumPy instead, using
> the generalized ufunc architecture, to do it over an arbitrary
> dimension of an array, rather than needing to invoke 'reduce' on
> logaddexp. I tried my hand at writing one but I couldn't manage to get
> it working for some reason, and I haven't had time to revisit it: http://mail.scipy.org/pipermail/numpy-discussion/2010-January/048067.html

I saw this original post and was hoping someone would post a response.
 Maybe now...

More information about the NumPy-Discussion mailing list