#include "declare.h"
float f(float *x)
{
 extern int n,M;
 extern int nfun;
 float fif;
 nfun++;
 switch(M)
 {
  case 1:
	 fif=(1-x[0])*(1-x[0])+100*(x[1]-x[0]*x[0])*(x[1]-x[0]*x[0]);
	 break;
  case 2:
	 fif=5.0*x[0]*x[0]+2.0*(x[1]-x[0]+1)*(x[1]-x[0]+1);
	 break;
 }
return fif;
}