Author tim.peters
Recipients mark.dickinson, rhettinger, serhiy.storchaka, skrah, steven.daprano, tim.peters
Date 2018-03-19.16:07:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1521475630.23.0.467229070634.issue33089@psf.upfronthosting.co.za>
In-reply-to
Content
Some notes on the hypot() code I pasted in:  first, it has to special case infinities too - it works fine if there's only one of 'em, but returns a NaN if there's more than one (it ends up computing inf/inf, and the resulting NaN propagates).

Second, it's not clear to me what the result "should be" if there's at least one infinity _and_ at least one NaN.  At the start, "anything with a NaN input returns a NaN" was the rule everything followed.  Later an exception to that was made for NaN**0 == 1, under the theory that it didn't really matter if the computation of the base screwed up, because anything whatsoever to the 0 power is 1 0 viewing NaN as meaning "we have no idea what the true value is", it simply doesn't matter what the true value is in this context.  By the same logic, if there's an infinite argument to hypot(), it doesn't matter what any other argument is - the result is +inf regardless.  So that requires some investigation.  Offhand I'm inclined to return NaN anyway.

Finally, if there is a robust single-rounding dot product, of course scaling can be skipped (and so eliminate another source of small errors).
History
Date User Action Args
2018-03-19 16:07:10tim.peterssetrecipients: + tim.peters, rhettinger, mark.dickinson, steven.daprano, skrah, serhiy.storchaka
2018-03-19 16:07:10tim.peterssetmessageid: <1521475630.23.0.467229070634.issue33089@psf.upfronthosting.co.za>
2018-03-19 16:07:10tim.peterslinkissue33089 messages
2018-03-19 16:07:10tim.peterscreate