def smoothing_error(x, x_a, A):
    """Return the smoothing error through the averaging kernel.

    Parameters:
        x (ndarray): Atmospherice profile.
        x_a (ndarray): A priori profile.
        A (ndarray): Averaging kernel matrix.

    Returns:
        ndarray: Smoothing error due to correlation between layers.
    """
    return A @ (x - x_a)