def polevl(x, coefs, n):
    """
    Evaluate polynomial of degree n.

    :param x: polynomial variable
    :type x: float
    :param coefs: polynomial coefficients
    :type coefs: list
    :param n: degree
    :type n: int
    :return: result as float
    """
    ans = 0
    power = len(coefs) - 1
    for coef in coefs:
        ans += coef * x**power
        power -= 1
    return ans