Correct me if I'm wrong, but I think your formula is not correct. If I feed it x=30, y=2, I get:
((2-30+16)&31)-16 = (-12&31)-16, which equals -4.
For x=2, y=30 I get:
((30-2+16)&31)-16 = (44&31)-16, which equals -4 (should have been 4).
This could probably be corrected by xor'ing the sign bit of the (x+y+16) part. That's pretty much what refractor does. Great solution! Mind if I use it in a game?

Tala: Also correct me if I'm wrong, but if x=30 and y=2, your formula gives -28 (should have been 4).
- Jacco.