1. P = 500, R = 1000 yields D = (1000-500)/500 = 0.5
2. P = -1500, R = -1000 yields D = (-1500-(-1000))/1000 = 0.5
In both cases since the difference (R-P) is the same and R is the same magnitude you get the same value for D, which is what we want. Maybe it would look more appealing if I wrote it as D = |(R-P)/R|, but mathematically it's the same thing since R-P can never be negative.