Genetic algorithm applied to find the minimum of a function