93 std::size_t counter1 = 0, counter2 = 0;
94 for( std::size_t i = 1; i < x.size(); i++ ) {
95 double y = x(i) - ::pow( x(0), 0.5*(1.0 + 3*(i-1)/(x.size()-1) ) );
100 for( std::size_t j = 0; j < x.size(); j++ )
102 product *= ::cos( 20 * y * M_PI / ::sqrt(
static_cast<double>( j ) ) );
103 value[1] -= product + 2.;
106 value[0] +=
sqr( y );
108 for( std::size_t j = 0; j < x.size(); j++ )
110 product *= ::cos( 20 * y * M_PI / ::sqrt(
static_cast<double>( j ) ) );
111 value[0] -= product + 2.;
115 value[0] *= 8./counter1;
118 value[1] *= 8./counter2;
119 value[1] += 1 - ::sqrt( x( 0 ) );