BivariateGridInterpolator interpolator = new BicubicSplineInterpolator();
BivariateFunction p = interpolator.interpolate(xval, yval, zval);
double x, y;
final RandomGenerator rng = new Well19937c(1234567L); // "tol" depends on the seed.
final UniformRealDistribution distX
= new UniformRealDistribution(rng, xval[0], xval[xval.length - 1]);
final UniformRealDistribution distY
= new UniformRealDistribution(rng, yval[0], yval[yval.length - 1]);