private static void check(double x,double y){
  double eps=Math.pow(2.0,-52.0);
  if (x == 0 & Math.abs(y) < 10 * eps)   return;
  if (y == 0 & Math.abs(x) < 10 * eps)   return;
  if (Math.abs(x - y) > 10 * eps * Math.max(Math.abs(x),Math.abs(y))) {
    throw new RuntimeException("The difference x-y is too large: x = " + Double.toString(x) + "  y = "+ Double.toString(y));
  }
}

private static void check ( double x , double y ) { double eps = Math . pow ( 2.0 , - 52.0 ) ; if ( x == 0 & Math . abs ( y ) < 10 * eps ) return ; if ( y == 0 & Math . abs ( x ) < 10 * eps ) return ; if ( Math . abs ( x - y ) > 10 * eps * Math . max ( Math . abs ( x ) , Math . abs ( y ) ) ) { throw new RuntimeException ( "The difference x-y is too large: x = " + Double . toString ( x ) + "  y = " + Double . toString ( y ) ) ; } }
check magnitude of difference of scalars .
