<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class=""><br class=""><div><br class=""><blockquote type="cite" class=""><div class="">On Oct 28, 2020, at 9:16 AM, Fred J. Tydeman <<a href="mailto:tydeman@tybor.com" class="">tydeman@tybor.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">C23 F.10.4.4 has<br class="">  hypot(x, ±0) is equivalent to fabs(x).<br class=""><br class="">Is that true for x being a Signaling NaN?<br class=""></div></div></blockquote><div><br class=""></div>No. We could say</div><div><br class=""></div><div><span class="Apple-tab-span" style="white-space:pre">        </span>hypot(x, ±0) is equivalent to fabs(x), for all x not a signaling NaN.</div><div><br class=""></div><div>But, either way, this seems to require hypot(x, ±0) to be a sign bit operation, which we don’t want for multiple reasons (treatment of NaNs,  preferred quantum exponent, canonicalization).</div><div><br class=""></div><div>754 says</div><div><br class=""></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div>hypot(x, y) is even in both operands.</div><div><br class=""></div><div>...</div><div><br class=""></div><div>For the hypot operation, hypot(±0, ±0) is +0, hypot(±∞, qNaN) is +∞, and hypot(qNaN, ±∞) is +∞. </div><div><br class=""></div></blockquote>Draft C23 F.10.4.4 says <br class=""><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;" class=""><div><br class=""></div><div>— hypot(x, y), hypot(y, x), and hypot(x, −y) are equivalent. </div><div>— hypot(x, ±0) is equivalent to fabs(x). </div><div>— hypot(±∞, y) returns +∞, even if y is a NaN.</div></blockquote><div><br class=""></div><div>The equivalence to fabs guarantees the 754 requirement about zeros and also requires correct rounding for y (or x) = ±0. We could replace the bullet about fabs with the two bullets</div><div><br class=""></div><div><blockquote style="margin: 0px 0px 0px 40px; border: none; padding: 0px;" class=""><div>— hypot(±0, ±0) is +0.</div><div>— hypot(x, ±0) is numerically equivalent to fabs(x). </div><div><br class=""></div></blockquote></div><div>- Jim Thomas</div><div><br class=""><blockquote type="cite" class=""><div class=""><div class=""><br class="">fabs(SNAN) raises no floating-point exceptions.<br class=""><br class=""><br class=""><br class="">---<br class="">Fred J. Tydeman        Tydeman Consulting<br class=""><a href="mailto:tydeman@tybor.com" class="">tydeman@tybor.com</a>      Testing, numerics, programming<br class="">+1 (702) 608-6093      Vice-chair of PL22.11 (ANSI "C")<br class="">Sample C99+FPCE tests: <a href="http://www.tybor.com" class="">http://www.tybor.com</a><br class="">Savers sleep well, investors eat well, spenders work forever.<br class=""><br class="">_______________________________________________<br class="">Cfp-interest mailing list<br class=""><a href="mailto:Cfp-interest@oakapple.net" class="">Cfp-interest@oakapple.net</a><br class="">http://mailman.oakapple.net/mailman/listinfo/cfp-interest<br class=""></div></div></blockquote></div><br class=""></body></html>