2 % -------------------------------------------------------------------------
3 % This file is part of BayesOpt, an efficient C++ library for
4 % Bayesian optimization.
6 % Copyright (C) 2011-2015 Ruben Martinez-Cantin <rmcantin@unizar.es>
8 % BayesOpt is free software: you can redistribute it and/or modify it
9 % under the terms of the GNU Affero General Public License as published by
10 % the Free Software Foundation, either version 3 of the License, or
11 % (at your option) any later version.
13 % BayesOpt is distributed in the hope that it will be useful, but
14 % WITHOUT ANY WARRANTY; without even the implied warranty of
15 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 % GNU Affero General Public License
for more details.
18 % You should have received a copy of the GNU Affero General Public License
19 % along with BayesOpt. If not, see <http:
20 % ------------------------------------------------------------------------
23 function y = camelback(x)
24 % -2 < x(1) < 2, -1 < x(2) < 1
25 % 2 Global minima: f(x) = -1.0316 (0.0898, -0.7126), (-0.0898, 0.7126)
26 tmp1 = (4 - 2.1 * x(1)^2 + (x(1)^4)/3) * x(1)^2;
28 tmp3 = (-4 + 4 * x(2)^2) * x(2)^2;
29 y = tmp1 + tmp2 + tmp3;