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?
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.
精彩评论