def legendre_polynomial(x: float, n: int) -> float:
    """Evaluate n-order Legendre polynomial.

    Args:
        x: Abscissa to evaluate.
        n: Polynomial order.

    Returns:
        Value of polynomial.
    """
    if n == 0:
        return 1
    elif n == 1:
        return x
    else:
        polynomials = [1, x]
        for k in range(1, n):
            new = ((2 * k + 1) * x * polynomials[-1] - k * polynomials[-2]) / (k + 1)
            polynomials.append(new)
        return polynomials[-1]