views:

49

answers:

1

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?

+1  A: 

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 usally considerably slower than *. Transcendentals are slower than Divide.

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

Ira Baxter
yes, this is what I need: page C-25 of the Intel optimization manual
wiso
Why I can find instruction for sin/cos/tan but not for log/exp?
wiso
They are there in the Intel instruction set. I'm not sure it computes those directly; IIRC, it computes some intermediate result from which those can be computed quite easily. Read over the FP instruction set carefully.
Ira Baxter