import math


def griewank(phenome):
    """The bare-bones Griewank function."""
    ssum = 0.0
    product = 1.0
    for i in range(len(phenome)):
        ssum += phenome[i] ** 2 / 4000.0
        product *= math.cos(phenome[i] / math.sqrt(i + 1.0))
    return ssum - product + 1.0