是否有一个快速的C或C ++标准库函数双precision平方根倒数? [英] Is there a fast C or C++ standard library function for double precision inverse square root?

查看:190
本文介绍了是否有一个快速的C或C ++标准库函数双precision平方根倒数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现自己打字

 双富= 1.0 /开方(...);

了很多,我听说现代处理器都内置了倒数平方根运算codeS。

有没有

C或C​​ ++标准库逆平方根函数

  1. 采用双precision浮点?

  2. 是准确 1.0 / SQRT(...)

  3. 一样快或比结果更快 1.0 / SQRT(...)


解决方案

没有。没有,没有。不是在C ++。不。

I find myself typing

double foo=1.0/sqrt(...);

a lot, and I've heard that modern processors have built-in inverse square root opcodes.

Is there a C or C++ standard library inverse square root function that

  1. uses double precision floating point?
  2. is as accurate as 1.0/sqrt(...)?
  3. is just as fast or faster than the result of 1.0/sqrt(...)?

解决方案

No. No, there isn't. Not in C++. Nope.

这篇关于是否有一个快速的C或C ++标准库函数双precision平方根倒数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆