-
Notifications
You must be signed in to change notification settings - Fork 335
Description
In https://gpuweb.github.io/gpuweb/wgsl/#reassociation it says:
An implementation may reassociate and/or fuse operations if the optimization is at least as accurate as the original formulation.
The qualification of being "at least as accurate" makes no sense when applied to reassociation. You can't statically determine if the reassociation is at least as accurate as the original expression.
For example, for (a + b) + c
vs. a + (b + c)
, catastrophic cancellation can occur with one or the other grouping of the terms, and is entirely dependent on the values of a, b, and c.
So it was an editoral error to qualify by "at least as accurate".
I can still see it applying for fusing operations, where an IEEE-compliant FMA can be more accurate than doing multiply followed by addition.