Auto-translated
In the physics engine, it's calculated as follows:
D(sum) = [D(bas)+MD(bas)+M(of)+M(luck)] * [1-M(def)],
where MD(bas) is a modifier determined by the difference between attack and defense. If the attack is lower, the sign is simply changed to a minus, and the coefficient is 0.025 instead of 0.05, but it is not enclosed in parentheses with the armor.
Is there an error in the physics engine? Have you tested your version?