math_func: optimization of LinearInterpolation