He may not have looked at the code for it. I know I haven't.
But even so, you don't know the exact equation used. Maybe it accounts for weapon rating, or training. Maybe it counts the new troops as a percentage of the total final troop count, or as a percentage of the initial troop count. Or something else completely. And you don't know where the cutoff from R4 to R5 is. It could even be a two-step process.
What I do know, from seeing some of the other calculations that Tom has used in the past, is that he rarely uses anything as simple as a straight average.