k22 = (sigma, ell) => {
const sigmasq = Math.pow(sigma, 2);
const ellsq = Math.pow(ell, 2);
const ell4 = Math.pow(ell, 4);
const ell8 = Math.pow(ell, 8);
return (x1, x2) => sigmasq / ell8 * (3 * ell4 - 6 * ellsq * Math.pow(x1 - x2, 2) + Math.pow(x1 - x2, 4)) * Math.exp(-Math.pow(x1 - x2, 2) / (2 * ellsq))
}