Is it possible to roll a significantly faster version of sqrt

后端 未结 6 1815
傲寒
傲寒 2020-12-14 01:38

In an app I\'m profiling, I found that in some scenarios this function is able to take over 10% of total execution time.

I\'ve seen discussion over the years of fast

6条回答
  •  情书的邮戳
    2020-12-14 01:56

    How accurate do you need your sqrt to be? You can get reasonable approximations very quickly: see Quake3's excellent inverse square root function for inspiration (note that the code is GPL'ed, so you may not want to integrate it directly).

提交回复
热议问题