argmin_testfunctions

Function cross_in_tray

Source
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\left(\left|\sin(x_1)\sin(x_2) \exp\left(\left| 100 - \frac{\sqrt{x_1^2+x_2^2}}{\pi} \right|\right)\right| + 1\right)^{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.