public static void subtractInPlaceUnsafe(double[] x,double[] y){
  for (int i=0; i < x.length; ++i) {
    if (Double.isNaN(x[i] - y[i])) {
      continue;
    }
    x[i]-=y[i];
  }
}

public static void subtractInPlaceUnsafe ( double [ ] x , double [ ] y ) { for ( int i = 0 ; i < x . length ; ++ i ) { if ( Double . isNaN ( x [ i ] - y [ i ] ) ) { continue ; } x [ i ] -= y [ i ] ; } }
if a subtraction results in nan ( i . e - inf - ( - inf ) ) does not perform the computation .
