# human generated code
import numpy as np

def trapezoidal_human(func, a, b, Np):
    """Numerical integration using the trapezoidal rule."""
    h = (b - a) / (Np - 1)

    x = np.linspace(a, b, Np)
    y = func(x)
    y[0] = y[0] / 2
    y[-1] = y[-1] / 2

    return np.sum(y) * h

