DR#471, cacosh and NaN signs (WG14 N2173)

Joseph Myers

This document relates to an issue described in reflector message 14270 (May 2016), and agreed on by the DR submitter in reflector message 14332 (August 2016).

DR#471 says that cacosh(0.0 + iNaN) should return NaN + iπ/2.

Now, cacosh(0.0 + iy) has imaginary part π/2 for positive y and −π/2 for negative y. Furthermore, the first bullet point for cacosh in G.6.2.1 says that cacosh(conj(z)) = conj(cacosh(z)). And it is also the general rule in C11 that the sign of a NaN is not significant.

Thus, I think that cacosh(0.0 + iNaN) should actually return NaN ± iπ/2, where the sign of the imaginary part is unspecified – similar to cacos(Inf + iNaN), csqrt(−Inf + iNaN) and many other cases where the sign of a zero or infinite part of a complex result is unspecified. If you make the sign specified, either you violate cacosh(conj(z)) = conj(cacosh(z)) or you violate the rule about signs of NaNs not being significant.

Proposed change to the resolution of DR#471: change “returns NaN + iπ/2” to “returns NaN ± iπ/2 (where the sign of the imaginary part of the result is unspecified)”.