That's not an equation, but a program line. You get killed troops by substracting captured from losses.

killed troops := military losses - captured troops (where captured troops is at most military losses / 2)