r/programming • • Jul 23 '26

Everyone Should Know SIMD

https://mitchellh.com/writing/everyone-should-know-simd
413 Upvotes

82 comments sorted by

View all comments

Show parent comment

3

u/tanner-gooding Jul 27 '26

You're likely thinking associativity, not commutativity.

x + y vs y + x is commutative and safe (per the IEEE 754 spec).

(x + y) + z vs x + (y + z) is associative and is not safe (for floating-point).