Skip to content
Better HN
Top
New
Best
Ask
Show
Jobs
Search
⌘K
undefined | Better HN
0 points
sva_
1mo ago
0 comments
Share
> floating point accumulation doesn't commute
It is commutative (except for NaN). It isn't associative though.
0 comments
default
newest
oldest
ekelsen
1mo ago
I think it commutes even when one or both inputs are NaN? The output is always NaN.
addaon
1mo ago
NaNs are distinguishable. /Which/ NaN you get doesn't commute.
ekelsen
1mo ago
I guess at the bit level, but not at the level of computation? Anything that relies on bit patterns of nans behaving in a certain way (like how they propagate) is in dangerous territory.
1 more reply
DavidVoid
1mo ago
Unless you compile with fast-math ofc, because then the compiler will assume that NaN never occurs in the program.
j
/
k
navigate · click thread line to collapse