Piecewise linear approximations of multivariate functions: a multiresolution-based compression algorithm suitable for circuit implementation