Add the Himmelblau function, as defined in Applied Nonlinear Programming.
[octave.git] / optimization / test_functions / himmelblau.m
1 function f = himmelblau(x1, x2)
2 ##
3 ## The eponymous function defined by Himmelblau in his Applied
4 ## Nonlinear Programming, 1972.
5 ##
6 ## It has four identical local minima,
7 ##
8 ## * f(3,2) == 0
9 ##
10 ## * f(-2.805118086952745, 3.131312518250573) == 0
11 ##
12 ## * f(-3.779310253377747, -3.283185991286170) == 0
13 ##
14 ## * f(3.584428340330492, -1.848126526964404) == 0
15 ##
16 f = (x1^2 + x2 - 11)^2 + (x1 + x2^2 - 7)^2;
17 end