def METHOD_NAME(x, y, s, kernel):
    sq = squared_distances(x, y)
    if kernel == "gaussian":
        return -np.exp(-sq / (s * s)) / (s * s)
    elif kernel == "laplacian":
        t = -np.sqrt(sq / (s * s))
        return np.exp(t) / (2 * s * s * t)
    elif kernel == "cauchy":
        return -1.0 / (s * (sq / (s * s) + 1)) ** 2
    elif kernel == "inverse_multiquadric":
        return -0.5 / ((s**2) * ((sq / (s * s) + 1) ** 1.5))