Skip to content

Commit f059e94

Browse files
committed
concrete example for lack of precision monotonicity
1 parent 4380d1c commit f059e94

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

text/0000-float-semantics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ Providing strict IEEE 754-2008 guarantees precludes many transformations, such a
201201
We could provide weaker guarantees to allow such transformations.
202202
(That would also make using the higher-precision x87 instructions conforming with the spec.)
203203
However, there is no way to bound the effect of such transformations on program behavior: they lead to different outcome observable via `to_bits` and even via pure float operations, which can balloon into arbitrary changes in behavior.
204-
There is also no "monotonicity of precision": while e.g. an FMA instead of mul-then-add will lead to a higher-precision result for this particular operation, this can in principle lead to a lower-precision result in later computations.
204+
There is also no "monotonicity of precision": while e.g. an FMA instead of mul-then-add will lead to a higher-precision result for this particular operation, this can in principle lead to a lower-precision result in later computations (e.g., `x*x - x*x` can produce non-zero results after being transformed to `x.mul_add(x, -x*x)`).
205205

206206
Given all these caveats, it seems preerrable to have explicit opt-in for such semantics-alterating transformations, e.g. via "fast" floating point operation intrinsics that don't provide strict IEEE semantics (and a type that uses those intrinsics for its operations).
207207

0 commit comments

Comments
 (0)