6 /* has two global minima at (0.09,-0.71) and (-0.09,0.71), plus
7 4 additional local minima */
9 double tst_obj(int n, const double *xy, double *g, void *unused)
14 f = ((x*x)*(4-2.1*(x*x)+((x*x)*(x*x))/3) + x*y + (y*y)*(-4+4*(y*y)));
15 printf("feval:, %d, %g, %g, %g\n", ++cnt, x,y, f);
18 ((2*x)*(4-2.1*(x*x)+((x*x)*(x*x))/3)
19 + (x*x)*(-4.2*x+4*(x*(x*x))/3)
22 (x + (2*y)*(-4+4*(y*y)) + (y*y)*(8*(y)));
27 int main(int argc, char **argv)
30 double x[2], l[2], u[2];
31 long int maxits = 0, maxtim = 0;
35 maxits = argc < 2 ? 100 : atoi(argv[1]);
40 info = stogo_minimize(n, tst_obj, NULL, x, &minf, l, u, maxits, maxtim);
42 printf("min f = %g at (%g,%g) after %d evals, return value %d\n",
43 minf, x[0], x[1], cnt, info);