[cfp-interest 3510] Re: hypot(x, y) - C2Y F.10.5.4

Damian McGuckin damianm at esi.com.au
Thu Jun 5 17:51:07 PDT 2025


On Thu, 5 Jun 2025, Vincent Lefevre wrote:

> The "=" is correct only when the result is not a NaN.

As 3 cases are all that are needed, I could say:

 	hypot(x, y) = hypot(y, x) = hypot(x, -y)

I thought at that point, we are talking a mathematical definition which 
does not need to say:

> The "=" is correct only when the result is not a NaN.

I note that the description of odd and even function in Annex F and Annex 
G always uses "=" and never qualifies the definition, e.g.

 	cacosh(conj(z)) = conj(cacosh(z)).

Certainly Annex G even relies on being able to assume that the '=' means 
'is equivalent to', or it reads that way to me.

> BTW, "hypot(+/-inf, y) returns +inf, even if y is a NaN" should
> be "[...] even if y is a quiet NaN".
>
> Similarly, in F.10.5.5 about pow, "for any {y,x}, even a NaN"
> should be "[...], even a quiet NaN". Or like F.10.5.6 (pown):
> "for all {y,x} not a signaling NaN".

What is "normative" for the meaning of "all x" given that any one of those 
x can be

    a zero, an infinity, subnormal, normal, a NaN

remembering that

a) each of the first two classifications for real floating types imply a
    set of only 2 elements, the others containing many more elements, and
    the last has two identically sized subsets, quiet and signaling; and

b) F.10.1#14 says the normative rule is ... " Functions with a NaN
    argument return a NaN result and raise no floating-point exception,
    except where explicitly stated otherwise"

Does (b) mean that normative is a quiet NaN which means that for the quiet 
NaN case, should/can mention of "quiet NaN" be wrapped in parentheses or 
just omitted?

Is normative behaviour for a signaling NaN, or all signaling NaNs, defined 
in is 5.3.5.3.3#10 .. "a signaling NaN generally raises a floating-point 
exception when occurring as an arithmetic operand". Note sure if the word 
"generally" in there means that this is not strictly a normative rule,

You have highlighted the mix of "any" and "all" that is seen in the 
current standard today. What is most consistent? While 'any' implies 
singular by definition, does 'all' imply the simgular or plural and does 
that change if in a definition or a sentence?

Thanks - Damian


More information about the cfp-interest mailing list