math_func: Template function for linear interpolation used