Approximate a smooth f(x,y) function with a polynomial function
Wikipedia:


  In statistics, polynomial regression is a form of regression analysis in which the relationship between the independent variable $x$ and the dependent variable $y$ is modelled as an $n^{th}$ degree polynomial in $x$.


One possible solution is the polynomial regression, that is, curve fitting method. Given a set of points $Y$ you may use one of two algorithms: closed form solution or gradient descent. When number of points is very large then the gradient descent is  faster than closed form solution. Also note that we measure error using residual sum of squares (RSS). Both algorithms finds coefficients by minimizing the RSS. This post may help as well.