Here's a formula for M.E.
A = Amount dropped
B = Bags dropped
M = Mastery (in decimal format)
C = Curve = 8 <- This number is a constant, will always be 8.
Minimum damage is calculated by multiplying A, B, M, and C, and then dividing that by 2.
( A * B * M * C ) / 2
Maximum damage is calculated by multiplying A, B, M, and C.
( A * B * M * C )
The hidden damage bonus is 25% of the damage of the bags, though I'm not sure if this number changes.
Source
Here's more information on the hidden damage bonus
Source