Raíz cuadrada inversa

  1. float InvSqrt (float x) {
  2.     float xhalf = 0.5f*x;
  3.     int i = *(int*)&x;
  4.     i = 0×5f3759df – (i >> 1);
  5.     x = *(float*)&i;
  6.     x = x*(1.5f – xhalf*x*x);
  7.     return x;
  8. }

Historia de la función en Quarkblog

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: