I was curious and decided to try my hand at figuring out the math of weapon balance. Some things are easy, like number of shots - a weapon with two shots is exactly as effective, in all circumstances, as two weapons with the same stats and 1 shot.
Other things are harder, like size. It might seem like a weapon that's twice as effective should be twice as large, but in practice it's more complicated. This can be seen by comparing a hypothetical Size 5 1 shot weapon to a Size 10 2 shot weapon of the same stats. Infantry would never want to use the Size 10 weapon, since they'd have half as many units with twice the shots, giving the same firepower but half the hp. However a light vehicle would probably want to use the Size 10 weapon, since it would result in 55% more firepower for 23% less hp. Complicating this is that sometimes you want tanky units, for example if they're providing cover for artillery, and other times you want glass cannon units, like the artillery itself.
However, you can set up a general rule based on whether a unit would win a fight with itself:
(New Firepower/Old Firepower) = (New Size/Old Size)^2
So if a weapon doubles the firepower (having 2 shots instead of 1, for instance) it becomes an upgrade in a straight fight if it increases the unit's total size by 41% or less. This also applies for vehicles with multiple weapon slots (I think you can choose not to fill a slot?) - plugging in the numbers shows that a vehicle with one medium anti-vehicle weapon will beat an equal size/cost of vehicles with two medium anti-vehicles.
Lastly, I decided to take a stab at damage. Damage is even weirder, since it depends on how many hp the unit you're shooting at has; if you do 6 damage to 1hp infantry, the weapon is effectively dealing 1 damage. However, going on the assumption that you can't predict what kind of units you'll be fighting, we can make a rough (emphasis on rough) estimate by averaging the results against every unit type in the game; this gives us how much damage we would expect it to do if fighting a truly random enemy, or one equally (by size) made up of every unit type. Additionally, since technology alters both hit points and damage, I tossed in a chance of a tech difference - 1/3rd chance the targets are lower tech, 1/3rd even tech, and 1/3rd higher tech. The results give how much damage, on average, we might expect an x damage weapon to inflict on a hit that gets past armor:
.5: .5
1: .99
2: 1.86
3: 2.62
4: 3.23
6: 4.05
9: 4.97
These numbers are probably off in a lot of ways, but it's also notable they don't consider armor piercing. A weapon with a higher armor piercing value is going to be more likely to inflict damage to a unit with high hit points, so there's some synergy between high damage and high AP, but that isn't reflected here. I'll reiterate that it's only meant as a very rough estimate.