Hi! On Tue, Aug 27, 2024 at 10:26:29AM +0200, David Brown wrote: > I think expression templates are what you need here. > > The "-ffast-math" optimisations are very specific to floating point > calculations, and are quite dependent on the underlying implementation > of floating point. Contrary to Segher's pessimism, "-ffast-math" is I'm not pessimistic! Merely realistic :-) > extremely useful and gives significantly better end results in > situations where it is appropriate. ... but I do not think it is appropriate to use in nearly as many cases as people do use it in. > But like any floating point work, > you need to understand the limitations and the suitability for the task > at hand. Exactly. So we violently agree :-) A compiler is not a computer algebra system, and the two things are only very vaguely related. Segher