static public double sphere_noise ( double [ ] x ) { double sum = 0.0 ; for ( int i = 0 ; i < x . length ; i ++ ) { sum += x [ i ] * x [ i ] ; } // NOISE // Comment the next line to remove the noise sum *= ( 1.0 + 0.1 * Math . abs ( random . nextGaussian ( ) ) ) ; return ( sum ) ; }
Sphere function with noise