from typing import List


def _polynomial(x: float, coefficients: List[float]) -> float:
    """Evaluate Σa_n x^n. Useful since most q's are polynomials!"""
    acc = 0.0
    xx = 1.0
    for coefficient in coefficients:
        acc += coefficient * xx
        xx *= x
    return acc