pub fn cross_in_tray<T>(param: &[T; 2]) -> T
where T: Float + Into<f64> + FromPrimitive,
Expand description

Cross-in-tray test function

Defined as

f(x_1, x_2) = -0.0001 * ( | sin(x_1)*sin(x_2)*exp(| 100 - \sqrt{x_1^2+x_2^2} / pi |) | + 1)^0.1

where x_i \in [-10, 10].

The global minima are at

  • f(x_1, x_2) = f(1.34941, 1.34941) = -2.06261.
  • f(x_1, x_2) = f(1.34941, -1.34941) = -2.06261.
  • f(x_1, x_2) = f(-1.34941, 1.34941) = -2.06261.
  • f(x_1, x_2) = f(-1.34941, -1.34941) = -2.06261.

Note: Even if the input parameters are f32, internal computations will be performed in f64.