26.12 FSQRT (PIII)


日期: 2000-04-02 15:00 | 联系我
关注我: Telegram, Twitter

26.12 FSQRT (PIII)

A fast way of calculating an approximate squareroot on the PIII is to multiply the reciprocal squareroot of x by x:

SQRT(x) = x * RSQRT(x)

The instruction RSQRTSS or RSQRTPS gives the reciprocal squareroot with a precision of 12 bits. You can improve the precision to 23 bits by using the Newton-Raphson formula described in Intel's application note AP-803:

x0 = RSQRTSS(a)

x1 = 0.5 * x0 * (3 - (a * x0)) * x0)

where x0 is the first approximation to the reciprocal squareroot of a, and x1 is a better approximation. The order of evaluation is important. You must use this formula before multiplying with a to get the squareroot.

标签: MMX 优化

 文章评论
目前没有任何评论.

↓ 快抢占第1楼,发表你的评论和意见 ↓

当前页面是本站的 百度 MIP 版本。
欲查看完整版本和发表评论请点击:完整版 »

 

程序员小辉 建站于 1997
Copyright © XiaoHui.com; 保留所有权利。