code: private double obj_func(double[] x_values) {
          int nopt = x_values.length;
          double d = (nopt == 2) ? 200.0 : 4000.0;
          double u1 = 0.0;
          double u2 = 1.0;
          for (int i = 0; i < nopt; i++) {
              u1 += (x_values[i] * x_values[i]) / d;
              u2 *= Math.cos(x_values[i] / Math.sqrt((double) i+1));
          }
          return u1 - u2 + 1;
      }
docs: /*
  This is the Griewank Function (2-D or 10-D)
  Bound: X(i)=[-600,600], for i=1,2,...,10
  Global minimum: 0, at origin
  
  Coded originally by Q Duan.  Editted for incorporation into Fortran DDS algorithm by
  Bryan Tolson, Nov 2005.
  
  DDS users should make their objective functions follow this framework
  user function arguments must be the same as above for the Griewank function
  
  I/O Variable definitions:
  x_values	an array of decision variable values (size nopt)
  return		the value of the objective function with x_values as input