import math


def michalewicz(ind, m=10.):
    """Michalewicz function defined as:
    $$ f(x) = - \sum_{i=1}^{n} \sin(x_i) \sin( \frac{i x_i^2}{\pi} )^(2*m)$$
    with a search domain of $0 < x_i < \pi, 1 \leq i \leq n$.
    """
    return - sum(( math.sin(ind[i]) * (math.sin(((i+1.)*(ind[i] **2.))/math.pi))**(2.*m) for i in range(len(ind)) )),