[Numpy-discussion] Bug in logaddexp2.reduce

josef.pktd@gmai... josef.pktd@gmai...
Wed Mar 31 19:08:32 CDT 2010


On Wed, Mar 31, 2010 at 7:37 PM, Warren Weckesser
<warren.weckesser@enthought.com> wrote:
> T J wrote:
>> On Wed, Mar 31, 2010 at 1:21 PM, Charles R Harris
>> <charlesr.harris@gmail.com> wrote:
>>
>>> Looks like roundoff error.
>>>
>>>
>>
>> So this is "expected" behavior?
>>
>> In [1]: np.logaddexp2(-1.5849625007211563, -53.584962500721154)
>> Out[1]: -1.5849625007211561
>>
>> In [2]: np.logaddexp2(-0.5849625007211563, -53.584962500721154)
>> Out[2]: nan
>>
>
> Is any able to reproduce this?  I don't get 'nan' in either 1.4.0 or
> 2.0.0.dev8313 (32 bit Mac OSX).  In an earlier email T J reported using
> 1.5.0.dev8106.



>>> np.logaddexp2(-0.5849625007211563, -53.584962500721154)
nan
>>> np.logaddexp2(-1.5849625007211563, -53.584962500721154)
-1.5849625007211561

>>> np.version.version
'1.4.0'

WindowsXP 32

Josef
>
> Warren
>
>> In [3]: np.log2(np.exp2(-0.5849625007211563) + np.exp2(-53.584962500721154))
>> Out[3]: -0.58496250072115608
>>
>> Shouldn't the result at least behave nicely and just return the larger value?
>> _______________________________________________
>> NumPy-Discussion mailing list
>> NumPy-Discussion@scipy.org
>> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>>
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion
>


More information about the NumPy-Discussion mailing list