Author mark.wiebe
Recipients Eli.Stevens, mark.dickinson, mark.wiebe
Date 2011-04-04.22:03:53
SpamBayes Score 4.13395e-05
Marked as misclassified No
Message-id <1301954639.57.0.839844777165.issue11734@psf.upfronthosting.co.za>
In-reply-to
Content
There's no disagreement, since they're different cases. Taking an arbitrary double, rounding to float, then rounding to half definitely has double-rounding issues. (And I would recommend constructing an example to add to the test case to make sure you understand what's going on.) Taking two halfs, doing a primitive arithmetic operation on them as floats, then rounding back to half is what Mark was referring to on the list.

In NumPy I also tried to err more towards accuracy and performance than having each intermediate be strictly half. The einsum function retains intermediate values as floats when operating on half, for example, and that's what I recommended in the documentation.

I'd also suggest adding some more to the test suite here to verify that ties are rounding to the nearest even properly. You can see some tests for this here:

https://github.com/numpy/numpy/blob/master/numpy/core/tests/test_half.py#L124
History
Date User Action Args
2011-04-04 22:03:59mark.wiebesetrecipients: + mark.wiebe, mark.dickinson, Eli.Stevens
2011-04-04 22:03:59mark.wiebesetmessageid: <1301954639.57.0.839844777165.issue11734@psf.upfronthosting.co.za>
2011-04-04 22:03:53mark.wiebelinkissue11734 messages
2011-04-04 22:03:53mark.wiebecreate