def FreudensteinRoth(x):
    """FreudensteinRoth(5, 4, 5, 4, ...., 5, 4) = 0"""
    n = len(x)
    tmp = 0
    for ii in range(0, n, 2):
        tmp += pow(-13 + x[ii] + ((5 - x[ii + 1]) * x[ii + 1] - 2) * x[ii +
            1], 2.0) + pow(-29 + x[ii] + ((x[ii + 1] + 1) * x[ii + 1] - 14) *
            x[ii + 1], 2.0)
    return tmp
