If you check this very nice page:
http://www.codeproject.com/Articles/69941/Best-Square-Root-Method-Algorithm-Function-Precisi
You'll see this program:
#define SQRT_MAGIC_F 0x5f3759df 
 float  sqrt2(const float x)
{
  const float xhalf = 0.5f*x;
  union // get bits for floating value
  {
    float x;
    int i;
  } u;
  u.x = x;
  u.i = SQRT_MAGIC_F - (u.i >> 1);  // gives initial guess y0
  return x*u.x*(1.5f - xhalf*u.x*u.x);// Newton step, repeating increases accuracy 
}
My question is: Is there any particular reason why this isn't implemented as:
#define SQRT_MAGIC_F 0x5f3759df 
 float  sqrt2(const float x)
{
  union // get bits for floating value
  {
    float x;
    int i;
  } u;
  u.x = x;
  u.i = SQRT_MAGIC_F - (u.i >> 1);  // gives initial guess y0
  const float xux = x*u.x;
  return xux*(1.5f - .5f*xux*u.x);// Newton step, repeating increases accuracy 
}
As, from disassembly, I see one MUL less. Is there any purpose to having xhalf appear at all?
 
    