Implement bilinear interpolation function