I think it is toleracance*(Damage-MD*0.85)
However wiki sometimes has the 0.85 already in calculations and sometimes it does not.
The 0.85 is more for pvp as more monsters as long as you know the offset to damage it is fibe.
To work that out you need to solve two simultaneous equations. I use a maths peogram, but I did it by hand a few years ago.
So basically if you use wiki, you may or may not need to multiply the MD by 0.85.