<commit_before>
#pragma once

template <typename T, typename Real = float>
T LinearInterpolate(T y1, T y2, Real x)
{
	return y1*(1 - x) + y2*x;
}

template <typename T, typename Real = float>
T CubicInterpolate(T p[4], Real x)
{
	return p[1] + (T) 0.5 * x*(p[2] - p[0] + x*(2*p[0] - 5*p[1] + 4*p[2] - p[3] + x*(3*(p[1] - p[2]) + p[3] - p[0])));
}

template <typename T, typename Real = float>
T BicubicInterpolate(T p[4][4], Real x, Real y)
{
	T arr[4];
	arr[0] = CubicInterpolate(p[0], y);
	arr[1] = CubicInterpolate(p[1], y);
	arr[2] = CubicInterpolate(p[2], y);
	arr[3] = CubicInterpolate(p[3], y);
	return CubicInterpolate(arr, x);
}

template <typename T, typename Real = float>
T TricubicInterpolate(T p[4][4][4], Real x, Real y, Real z)
{
	T arr[4];
	arr[0] = BicubicInterpolate(p[0], y, z);
	arr[1] = BicubicInterpolate(p[1], y, z);
	arr[2] = BicubicInterpolate(p[2], y, z);
	arr[3] = BicubicInterpolate(p[3], y, z);
	return CubicInterpolate(arr, x);
}<commit_msg>+ Fixed interpolators (no C++11 full support yet :( )<commit_after>
#pragma once

template <typename T>
T LinearInterpolate(T y1, T y2, float x)
{
	return y1*(1 - x) + y2*x;
}

template <typename T>
T CubicInterpolate(T p[4], float x)
{
	return p[1] + (T) 0.5 * x*(p[2] - p[0] + x*(2*p[0] - 5*p[1] + 4*p[2] - p[3] + x*(3*(p[1] - p[2]) + p[3] - p[0])));
}

template <typename T>
T BicubicInterpolate(T p[4][4], float x, float y)
{
	T arr[4];
	arr[0] = CubicInterpolate(p[0], y);
	arr[1] = CubicInterpolate(p[1], y);
	arr[2] = CubicInterpolate(p[2], y);
	arr[3] = CubicInterpolate(p[3], y);
	return CubicInterpolate(arr, x);
}

template <typename T>
T TricubicInterpolate(T p[4][4][4], float x, float y, float z)
{
	T arr[4];
	arr[0] = BicubicInterpolate(p[0], y, z);
	arr[1] = BicubicInterpolate(p[1], y, z);
	arr[2] = BicubicInterpolate(p[2], y, z);
	arr[3] = BicubicInterpolate(p[3], y, z);
	return CubicInterpolate(arr, x);
}
{'fraction_non_alphanumeric': 0.215376513954713, 'fraction_numerical': 0.049499736703528176, 'mean_word_length': 4.757575757575758, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1750528', 'n_tokens_mistral': 938, 'n_tokens_neox': 920, 'n_words': 218}