Simulated Annealing: Find minimum and maximum of custom function | ScratchStats