タグ

ブックマーク / www.riken.jp (1)

  • fast sqrt

    高速根号計算 (fast sqrt algorithm) 概要: C言語のsqrt(float)より精度は若干劣るものの,2倍以上速いsqrtのalgorithm. ググって見つけた物が,非常に面白かったのでまとめておく.精度より速度が求められる場面で活躍する.   参考文献 [1] David Eberly, Fast Inverse Square Root (Revisited), http://www.geometrictools.com/Documentation/ FastInverseSqrt.pdf, 1/2002-. 実装 //---Algorithm float(IEEE754)用------ inline float t_sqrtF( const float& x ) { float xHalf = 0.5f * x; int tmp = 0x5F3759DF

  • 1