public static double invSqrtQuick(final double value){
  if (USE_JDK_MATH) {
    return 1 / Math.sqrt(value);
  }
  return Double.longBitsToDouble(0x5FE6EB50C7B537A9L - (Double.doubleToRawLongBits(value) >> 1));
}

public static double invSqrtQuick ( final double value ) { if ( USE_JDK_MATH ) { return 1 / Math . sqrt ( value ) ; } return Double . longBitsToDouble ( 0x5FE6EB50C7B537A9L - ( Double . doubleToRawLongBits ( value ) > > 1 ) ) ; }
quick inverse of square root , with a max relative error of about 3 . 44e - 2 for values in [ double . min_normal , double . max_value ] , and worse accuracy outside this range . this implementation uses zero step of newton ' s method . here are the max relative errors on [ double . min_normal , double . max_value ] depending on number of steps , if you want to copy - paste this code and use your own number : n = 0 : about 3 . 44e - 2 n = 1 : about 1 . 75e - 3 n = 2 : about 4 . 6e - 6 n = 3 : about 3 . 17e - 11 n = 4 : about 3 . 92e - 16 n = 5 : about 3 . 03e - 16
