public static boolean isAnyInfinity(double[] x){
  for (  double value : x) {
    if (Double.isInfinite(value)) {
      return true;
    }
  }
  return false;
}

public static boolean isAnyInfinity ( double [ ] x ) { for ( double value : x ) { if ( Double . isInfinite ( value ) ) { return true ; } } return false ; }
check whether x contains infinity
