Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What are the optimizations facilitated by -ffinite-math-only?

All the info I can find in documentation and the web for -ffinite-math-only is "Allow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or +-Infs." This does not seem forthcoming to me. Does anyone know exactly what those optimizations are? Thanks

like image 229
user1332148 Avatar asked Apr 13 '12 17:04

user1332148


People also ask

What is optimization strategy?

Optimization strategy is used to search and optimize the transform parameters for the maximization of the similarity value between the warped source image and the target image.

What is the importance of optimizing?

The purpose of optimization is to achieve the “best” design relative to a set of prioritized criteria or constraints. These include maximizing factors such as productivity, strength, reliability, longevity, efficiency, and utilization.

What is an Optimisation study?

Optimisation research is engaged in the development of fundamental mathematical theory for the creation of new optimisation techniques for the solution of challenging optimisation problems.

What is health Optimisation?

In a nutshell, health optimization is the practice of looking at your health from a perspective of, “how can I make this even better” or “what can I do to feel my best every day and live a long and healthy life,” versus, “how can I fix this thing that's wrong with me.”


1 Answers

Lots of little things can be optimized under that assumption, like:

  • x == x --> 1
  • x * 1 --> x
  • x >= y --> !(x < y) and similar.
  • x/x --> 1 if the compiler can prove x != 0.
  • it may allow a compiler to use hardware max/min instructions for expressions like x > y ? x : y.
  • ... lots more

You often see this assumption together with assumptions like "sign of zero doesn't matter", which then allows things like:

  • x - x --> 0
  • 0 / x --> 0
  • x * 0 --> 0
like image 69
Stephen Canon Avatar answered Oct 03 '22 03:10

Stephen Canon