Mini-library for gradient interpolation