Two - dimensional Test Functions:

Sphere:

f[x_, y_] := x^2 + y^2;
Print["Sphere: "];
StylePrint[f[x, y]];
Plot3D[f[x, y], {x, -5.12, 5.12}, {y, -5.12, 5.12}, 
      PlotPoints -> 50, PlotRange -> All]

Rosenbrock:

f[x_, y_] := 
        100*(x^2 - y)^2 + (1 - x)^2;
Print["Rosenbrock: "];
StylePrint[f[x, y]];
Plot3D[f[x, y], {x, -2.048, 2.048}, {y, -2.048, 2.048}, 
      PlotPoints -> 50, 
      PlotRange -> All]

Stairs:

f[x_, y_] := 
        IntegerPart[x] + IntegerPart[y];
Print["Stairs: "];
StylePrint[f[x, y]];
Plot3D[f[x, y], {x, -5.12, 5.12}, {y, -5.12, 5.12}, 
      PlotPoints -> 50, PlotRange -> All]

NormalDistributedNoise:

Gauss[x_] := 
        1/(Sqrt[2  π])*Exp[-x^2/2];
f[x_, y_] := 
        x^4 + 20*Gauss[x] + 2*y^4 + 20*Gauss[y];
Print["NormalDistributedNoise: "];
StylePrint[f[x, y]];
Plot3D[f[x, y], {x, -1.28, 1.28}, {y, -1.28, 1.28}, 
      PlotPoints -> 50, PlotRange -> All]

Shekel' s Foxholes:

A := {{-32, -16, 0, 16, 32, -32, -16, 0, 16, 
            32, -32, -16, 0, 16, 32, -32, -16, 0, 16, 
            32, -32, -16, 0, 16, 
            32}, 
{-32, -32, -32, -32, -32, -16, -16, -16, -16, -16, 0, 0, 0, 0, 0, 16, 16, 
            16, 16, 16, 32, 32, 32, 32, 32}};
f[x_, 
          y_] := (∑_(j = 1)^25)(1/(1 + (x - A[[1]][[j]])^6 + (y - A[[2]][[j]])^6));
Print["Shekel's Foxholes: "];
Plot3D[f[x, y], {x, -65.536, 65.536}, {y, -65.536, 65.536}, 
      PlotPoints -> 50, PlotRange -> All]

Rastrigin:

f[x_, y_] := 
        20 + (x^2 - 10*Cos[2*π*x]) + (y^2 - 
              10*Cos[2*π*y]);
Print["Rastrigin: "];
StylePrint[f[x, y]];
Plot3D[f[x, y], {x, -5.12, 5.12}, {y, -5.12, 5.12}, 
      PlotPoints -> 50, PlotRange -> All]

Schwefel_F7:

f[x_, y_] := (x + y)^2;
Print["Schwefel_1: "];
StylePrint[f[x, y]];
Plot3D[f[x, y], {x, -65.536, 65.536}, {y, -65.536, 65.536}, 
      PlotPoints -> 50, PlotRange -> All]

Schwefel_F8:

f[x_, y_] := -x*Sin[(Sqrt[Abs])[x]] - 
          y*Sin[(Sqrt[Abs])[y]];
Print["Schwefel_2: "];
StylePrint[f[x, y]];
Plot3D[f[x, y], {x, -500, 500}, {y, -500, 500}, 
      PlotPoints -> 50, PlotRange -> All]

Griewangk:

f[x_, y_] := (x^2 + y^2)/4000 - (Cos[x]*Cos[y/(Sqrt[2])]) + 
          1;
Print["Griewangk: "];
StylePrint[f[x, y]];
Plot3D[f[x, y], {x, -600, 600}, {y, -600, 600}, 
      PlotPoints -> 50, PlotRange -> All]

Schaffer_F6:

f[x_, 
          y_] := ((Sin[(Sqrt[x^2 + y^2])])^2 - 
                0.5)/((1 + 0.001*(x^2 + y^2))^2) + 
          0.5;
Print["Schaffer_F6: "];
StylePrint[f[x, y]];
Plot3D[f[x, y], {x, -100, 100}, {y, -100, 100}, 
      PlotPoints -> 50, PlotRange -> All]

Ackley:

f[x_, y_] := 
        20 + E - 
          20*E^(-0.2*(Sqrt[1/2*(x^2 + y^2)])) - E^(1/
                  2*(Cos[2*π*x] + 
                    Cos[2*π*y]));
Print["Ackley: "];
StylePrint[f[x, y]];
Plot3D[f[x, y], {x, -32.768, 32.768}, {y, -32.768, 32.768}, 
      PlotPoints -> 50, PlotRange -> All]