On Mon, 18 Sep 2023, Florian Weimer via Gcc wrote:
> But the contraction would still be valid after an isfinite check > (something that ranger might catch these days), or with with > -ffinite-math-only in general. Right? Nope, still not valid for negative zero ('x + x - x' would yield positive zero in the default rounding mode). > > Contracting 'x + x - x' to fma(x, 2, -x) would be fine. > > It still changes the result, doesn't it? I don't follow. I doesn't change the result for infinities (produces a NaN). It changes the result when x is so large that 'x + x' is not representable (exponent would overflow), but that's exactly what contraction is about? Alexander