public static void UF7(double[] x,double[] f,int nx){
  int count1=0;
  int count2=0;
  double sum1=0.0;
  double sum2=0.0;
  double yj;
  for (int j=2; j <= nx; j++) {
    yj=x[j - 1] - Math.sin(6.0 * PI * x[0] + j * PI / nx);
    if (j % 2 == 0) {
      sum2+=yj * yj;
      count2++;
    }
 else {
      sum1+=yj * yj;
      count1++;
    }
  }
  yj=Math.pow(x[0],0.2);
  f[0]=yj + 2.0 * sum1 / (double)count1;
  f[1]=1.0 - yj + 2.0 * sum2 / (double)count2;
}

public static void UF7 ( double [ ] x , double [ ] f , int nx ) { int count1 = 0 ; int count2 = 0 ; double sum1 = 0.0 ; double sum2 = 0.0 ; double yj ; for ( int j = 2 ; j <= nx ; j ++ ) { yj = x [ j - 1 ] - Math . sin ( 6.0 * PI * x [ 0 ] + j * PI / nx ) ; if ( j % 2 == 0 ) { sum2 += yj * yj ; count2 ++ ; } else { sum1 += yj * yj ; count1 ++ ; } } yj = Math . pow ( x [ 0 ] , 0.2 ) ; f [ 0 ] = yj + 2.0 * sum1 / ( double ) count1 ; f [ 1 ] = 1.0 - yj + 2.0 * sum2 / ( double ) count2 ; }
evaluates the uf7 problem .
