TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Fast inverse square root

37 点作者 r11t超过 15 年前

5 条评论

DarkShikari超过 15 年前
Curiously enough, today, such a hack is completely pointless (at least on x86): the <i>rsqrtps</i> instruction can do 4 of these in just 3 clock cycles, with higher accuracy to boot.<p>Most modern instruction sets with remotely decent floating point support have a similar instruction, in large part <i>because</i> of the prevalence of hacks like this in the past.
评论 #896277 未加载
评论 #896279 未加载
评论 #896661 未加载
dkersten超过 15 年前
I remember when this was being discussed over at gamedev.net, where Chris Lomont came up with his version. The wikipedia article explains it much clearer though :-P<p>The history of this particular hack can be found over at Beyond3D:<p>Part 1: <a href="http://www.beyond3d.com/content/articles/8/" rel="nofollow">http://www.beyond3d.com/content/articles/8/</a><p>Part 2: <a href="http://www.beyond3d.com/content/articles/15/" rel="nofollow">http://www.beyond3d.com/content/articles/15/</a><p>They trace it all the way back to Greg Walsh, who apparently came up with the hack while working on the Titan graphics computer at Ardent Computer in the late 80's, who got the idea while working with Cleve Moler, the author of matlab.
sophacles超过 15 年前
I hope someday to actually understand this. It seems to come up once a year or so, and each time I understand a bit more... so hopefully in a few years...
评论 #896372 未加载
评论 #896861 未加载
评论 #896225 未加载
sandGorgon超过 15 年前
I think the best paper that explains the magic number (0x5f3759df) is <a href="http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf" rel="nofollow">http://www.lomont.org/Math/Papers/2003/InvSqrt.pdf</a><p>Lomont traces the history of the algorithm and the possible way that the magic number was derived - including more magic numbers (0x5f375a86)
leif超过 15 年前
"isn't that just x*x?"
评论 #896627 未加载