slave cost math conversion question

So, donkeys aren't famous for their math skills. See: !9277 (comment 158287).

My record system can only handle adding or subtracting a value from a total, so I needed to convert something that multiplied the total and then replaced it:

x = x * N;

became

x += (x * N) - x;

However, this produced a big bonus for retiring age slaves, so I thought my conversion was wrong and reversed it:

x += x - (x * N);

But the more I think on it, the more I think my original is correct and perhaps the retirement math itself was always giving a bonus (incorrectly). Help?

Edited by lowercasedonkey