Skip to content

Commit cafb630

Browse files
committed
[Lang] qd.precise: fix fast_math=False table row; a+0 fold is precise-gated, not fast_math-gated
1 parent 426198e commit cafb630

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

docs/source/user_guide/precise.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ def k(...):
7676
| Setting | Non-precise op | `qd.precise` op |
7777
|---|---|---|
7878
| `fast_math=True` | reassoc / contract / simplify | IEEE-strict |
79-
| `fast_math=False` | IEEE-strict | IEEE-strict (redundant but harmless) |
79+
| `fast_math=False` | mostly IEEE-strict (*) | IEEE-strict |
80+
81+
(*) Under `fast_math=False` most rewrites are already globally disabled, but the `a + 0 -> a` fold for FP adds is gated on `qd.precise` only (not on `fast_math`), so `(-0.0) + 0.0` still folds to `-0.0` without the tag. `qd.precise` is therefore not fully redundant under `fast_math=False` for code that depends on signed-zero semantics.
8082

8183
The recommended workflow is to leave `fast_math=True` globally for throughput and reach for `qd.precise` only in the handful of spots that need IEEE behavior.
8284

0 commit comments

Comments
 (0)