static public double schwefel_102 ( double [ ] x ) { double prev_sum , curr_sum , outer_sum ; curr_sum = x [ 0 ] ; outer_sum = ( curr_sum * curr_sum ) ; for ( int i = 1 ; i < x . length ; i ++ ) { prev_sum = curr_sum ; curr_sum = prev_sum + x [ i ] ; outer_sum += ( curr_sum * curr_sum ) ; } return ( outer_sum ) ; }
Schwefel s problem 1 . 2