Ruggero Turra
Ruggero Turra

Reputation: 17680

CPU floating operations cost

I'm interesting in the time cost on a modern desktop CPU of some floating point operations in order to optimize a mathematical evaluation. In particular I'm interested on the comparison between complex operations like exp, log and simple operation like +, *, /.

I tried to search for this information, but I could't find a source.

What is the cost of floating point operations?

Upvotes: 7

Views: 1398

Answers (1)

Ira Baxter
Ira Baxter

Reputation: 95344

Modern CPUs will do float + and - in a few clocks. Many will do * with a small number of clocks, but more than + and -. Divide is usually considerably slower than *. Transcendentals are slower than Divide.

You can likely get some ideas of speed by looking in Intel optimization manuals.

Upvotes: 2

Related Questions