UPDATE: My terminology below is wrong. The \"forward\" algorithm I describe in \"Lerp2D\" (which I need inverse-of) takes 4 arbitrary corners. It is linear
To simplify, let's begin by just considering a single intepolated value z.
Assume four values z00, z01, z10, z10, and two weights w0 and w1 applied to the first and second index, giving
z0 = z00 + w0 × (z10 - z00)
z1 = z01 + w0 × (z11 - z01)
and finally
z = z0 + w1 × (z1 - z0)
= z00 + w0 × (z10 - z00) + w1 × (z01 - z00) + w1 × w0 × (z11 - z10 - z01 + z00)
So, for your problem you will have to invert a two dimensional quadratic equation
x = x00 + w0 × (x10 - x00) + w1 × (x01 - x00) + w1 × w0 × (x11 - x10 - x01 + x00)
y = y00 + w0 × (y10 - y00) + w1 × (y01 - y00) + w1 × w0 × (y11 - y10 - y01 + y00)
Unfortunately, there isn't a simple formula to recover w0 and w1 from x and y. You can, however, treat it as a non-linear least squares problem and minimise
(xw(w0,w1) - x)2 + (yw(w0,w1) - y)2
which you can do efficiently with the Levenberg–Marquardt algorithm.
Edit: Further Thoughts
It has occurred to me that you might be satisfied with an interpolation from (x, y) to (w0, w1) rather than the actual inverse. This will be less accurate in the sense that rev(fwd(w0, w1)) will likely be further from (w0, w1) than the actual inverse.
The fact that you're interpolating over an irregular mesh rather than a regular grid is going to make this a trickier proposition. Ideally you should join up your (x, y) points with non-overlapping triangles and use barycentric coordinates to linearly interpolate.
For numerical stability you should avoid shallow, pointy triangles. Fortunately, the Delaunay triangulation satifies this requirement and isn't too difficult to construct in two dimensions.
If you would like your reverse interpolation to take a similar form to your forward interpolation you can use the basis functions
1
x
y
x × y
and compute coefficients ai, bi, ci and di (i equal to 0 or 1) such that
w0 = a0 + b0 × x + c0 × y + d0 × x × y
w1 = a1 + b1 × x + c1 × y + d1 × x × y
By substituting the relevant known values of x, y, w0 and w1 you'll get four simultaneous linear equations for each w that you can solve to get its coefficients.
Ideally you should use a numerically stable matrix inversion algorithm that can cope with near singular matrices (e.g. SVD), but you may be able to get away with Gaussian elimination if you're careful.
Sorry I can't give you any simpler options, but I'm afraid that this really is a rather tricky problem!