code: public static float invSqrtFast(final float a) {
      	final float half_a = 0.5f*a;
          
          float ux = a;
          final int ui = 0x5f3759df - (Float.floatToIntBits(ux) >> 1);
          
          final float floatBits = Float.intBitsToFloat(ui);
          ux = floatBits * (1.5f - half_a * floatBits * floatBits);
          
          // After the first computation of 'ux' above, we no longer have to use 'floatBits'.
          // We can just use 'ux' as is.  Note that this line can be repeated arbitrarily 
          // many times to increase accuracy.  Based on a few tests, I see that two 
          // iterations produces the same result as 1 / Math.sqrt() does.
          ux = ux * (1.5f - half_a * ux * ux);
          
          return ux;
      }
docs: Compute the inverse (reciprocal of) the square root.  Note this is a "fast"
  version based on
  <a href="http://en.wikipedia.org/wiki/Methods_of_computing_square_roots#Reciprocal_of_the_square_root">Greg Walsh's algorithm</a>.
  Basic testing shows this to be accurate within an epsilon of at least
  <code>0.000001</code>.
  
  @param a a number on which evaluation is done
  @return inverse square root of a