The reasons your numbers are coming out wrong, and this messed me up first too.
The Trade pact multiplier gets added to the base production 'from modules' stat.
so for instance;
4 x 110 should equal 440 at all times,
but it doesn't because your treaty gets multiplied to this number

we have 4 x 110 which equals 519
we have 8 trade pacts = 18%
Basically the multiplier gets added to the modules stat before the other multipliers.
The numbers come out so close sometimes that it seems like a weird error, but if you use it the right way, your spreadsheet or whatever will be 100% accurate.