The method searches for a local minimum of a function defined in an n-dimensional space.
An n-dimensional simplex — an “amoeba” — moves downhill along the surface of the function until it surrounds the minimum.
Then, the amoeba contracts around the minimum until its size is less than the tolerance value.
Wikipedia has a nice description of the algorithm: link
In my code, the amoeba is a list of n+1 lists of n-dimensional coordinates — n+1 vertices of an n-simplex.
The optional parameters are the tolerance, the maximum number of iterations, the distance function (for now I implemented only Euclidean but other distance functions can be added), and the parameters specifying how the amoeba moves (the coefficients of reflection, expansion, contraction and shrinking).
The code for both functions (
himmelblau) is in the end of the file.