argmin_testfunctions

Function ackley

Source
pub fn ackley<T>(param: &[T]) -> T
where T: Float + FromPrimitive + Sum,
Expand description

Ackley test function

Defined as

f(x1,x2,,xn)=aexp(b1ni=1nxi2)exp(1ni=1ncos(cxi))+a+exp(1) f(x_1, x_2, …, x_n) = -a\exp\left(-b\sqrt{\frac{1}{n}\sum_{i=1}^{n}x_i^2}\right) - \exp\left(\frac{1}{n}\sum_{i=1}^{n}\cos(cx_i)\right) + a + \exp(1)

where xi[32.768,32.768]x_i \in [-32.768,\,32.768] and usually a=20a = 20, b=0.2b = 0.2 and c=2πc = 2\pi.

The global minimum is at f(x1,x2,,xn)=f(0,0,,0)=0f(x_1, x_2, …, x_n) = f(0, 0, …, 0) = 0.