// Definition of a test function for Steepest Descent // f = (x1-1)^2 + (x2-2)^2 + 0.7*sin(x1*x2) #include "SteepestDescent.h" float F(const Vec x){ int n; float x1, x2, f; n = x.n; if(x.n!=2){ printf("inapropriate input"); return 0.0; } x1=x.comp[0]; x2=x.comp[1]; f=(x1-1)*(x1-1)+(x2-2)*(x2-2) + 0.7*sin(x1*x2); return f; }