On Mon, Aug 26, 2024 at 06:00:21PM +0200, Kai Song via Gcc-help wrote: > I would like to learn more how GCC implements algebraic optimization > heuristic such as given in -ffast-math . Oh dear. > In particular, I have a type Number that is used in a code -ffast-math means you are not dealing with numbers at all, but instead with quantities somewhat akin to numbers, and you don't give two hoots about what happens with them. It replaces floating point expressions by other expressions that are at best vaguely related, and almost always compute a very different result. If you do not care about your numbers at all, and (against better judgement) prefer more speed over all quality, you can use -ffast-math. Or, you can admit you think arithmetic is magic. It is fine to use then, too. Segher