There is an additional background consideration: fleshy type enemies with low armor (such as Reapers) have slightly lower inherent resistance to autofire damage types (Ballistic, Rapid Laser, Rapid Plasma) but slightly higher resistance to penetrator damage types (Armor Penetrator, Penetrator Laser, Penetrator Plasma). High armor low health enemies (such as Cyberdiscs) have the inverse. This is just a small fudge factor, usually causing them to take 10-20% more or less damage (after resistance but before armor) which helps ensure that cannons are great against armored targets while machine guns are great against fleshy targets.
Here are some example calculations for HC-Alloy and Machinegun-Alloy vs. Cyberdisc and Reaper in Genius difficulty:
Heavy Cannon/Alloy: 60 Armor Penetrator // armor effectiveness: 36%
Machinegun/Alloy: 24 Ballistic // armor effectiveness: 75%
Cyberdisc: 60 Health 52 Armor // damage effectiveness: Armor Penetrator 120% / Ballistic 80%
Reaper: 197 Health 11 Armor // damage effectiveness: Armor Penetrator 56% / Ballistic 84%
Heavy Cannon base damage: 45-75
Heavy Cannon hit vs. Cyberdisc deals: 45-75 * 1.2 = 54-90 - (52 * 0.36 = 18.72) = 35.28-71.28
Heavy Cannon deals percentage of Cyberdisc's health: 35.28-71.28 / 60 = 58.8%-118.8%
Odds of Heavy Cannon killing Cyberdisc in one hit: 11.28 / 36 = 31.3%
Heavy Cannon hit damage to Cyberdisc armor: 54-90 * 0.036 = 1.94-3.24
Machinegun base damage: 18-30
Machinegun hit vs. Cyberdisc deals: 18-30 * 0.8 = 13.5-22.5 - (52 * 0.75 = 39) = 0.00
Machinegun hit damage to Cyberdisc armor: 13.5-22.5 * 0.075 = 1.01-1.69
Machinegun hitx5 damage to Cyberdisc armor: 13.5-22.5 * 0.075 * 5 = 5.06-8.44 (heavily biased toward the median value, ~6.8)
Heavy Cannon hit vs. Reaper deals: 45-75 * 0.56 = 25.2-42 - (11 * 0.36 = 3.96) = 21.24-38.4
Heavy Cannon hit deals percentage of Reaper's health: 21.24-38.4 / 197 = 10.8%-19.5%
Heavy Cannon hit damage to Reaper armor: 21.24-38.4 * 0.036 = 0.76-1.38
Machinegun hit vs. Reaper deals: 18-30 * 0.84 = 15.12-25.2 - (11 * 0.75 = 8.25) = 6.87-16.95
Machinegun hit damage to Reaper armor: 15.12-25.2 * 0.075 = 1.134-1.89
Machinegun hitx5 vs. Reaper deals: (15.12-25.2 - (11 * 0.75 = 8.25)) + (15.12-25.2 - ((11 - 1.134-1.89) * 0.75 = 8.25)) + (15.12-25.2 - ((11 - 2.268-3.78) * 0.75 = 8.25)) + (15.12-25.2 - ((11 - 3.402-5.67) * 0.75 = 8.25)) + (15.12-25.2 - ((11 - 4.536-7.56) * 0.75 = 8.25))
(15.12-25.2 - (11 * 0.75 = 8.25)) + (15.12-25.2 - ((9.866-9.11) * 0.75 = 8.25)) + (15.12-25.2 - ((8.732-7.22) * 0.75 = 8.25)) + (15.12-25.2 - ((7.598-5.33) * 0.75 = 8.25)) + (15.12-25.2 - ((6.464-3.44) * 0.75 = 8.25))
(15.12-25.2 - 8.25) + (15.12-25.2 - 7.3995-6.8325) + (15.12-25.2 - 6.549-5.415) + (15.12-25.2 - 5.6985-3.9975) + (15.12-25.2 - 4.848-2.58)
6.87-16.95 + 7.7205-18.3675 + 8.571-19.785 + 9.4125-21.2025 + 10.272-22.62 = 42.8-98.9 (heavily biased toward the median value, ~71)
Machinegun hit deals percentage of Reaper's health: 6.87-16.95 / 197 = 3.49%-8.60%
Machinegun hitx5 deals percentage of Reaper's health: 42.8-98.9 / 197 = 21.7%-50.2% (heavily biased toward the median value, ~36%)
Machinegun hitx5 damage to Reaper armor: 4.25-7.09 (heavily biased toward the median value, ~5.7)
Machinegun hitx5 deals percentage of Reaper's armor: 4.25-7.09 / 11 = 38.6%-64.5% (heavily biased toward the median value, ~51%)