D = Decay Rate
O = Optimal Range
R = Range
K = Damage multiplier
If O > R, then (K = 1)
If O < R then (K = 500 / R * D/100)
So if your Decay rate is 25, and your optimal range is 150, then it would look like this:
0m: 100% damage
This is before defenses. So if your weapon does 1500 damage, and the opponent has say, 800 defense, then you suddenly pass into the ineffective range at 250m.
As for CE weapons, they just have a very high decay rate value but follow the same formula.
This is only one part of the story though, firing accuracy is a huge impact on damage over range. A change from 99 to 98 accuracy makes a big impact on the number of hits you can make at range, more so than a difference from 90 to 50.
The issue is that the highest DPS gatling guns either weigh a ton (3500 ammo), or have shitty accuracy (800 ammo), or are really limited on ammo (300 and 150 ammo).
For firing accuracy, I've created my own estimation formula. It takes the diameter of the AC, divided by the spread of the shots. If the shots spread wider (twice the diameter = 50% of the shots hit).
D = Diameter of target (enemy AC is always 5m)
R = Range
A = Firing Accuracy
T = Firing Stability
tan = tangent
rad = degrees to radian conversion
D / (R* tan((rad(50-(A/2)/(/T/100))))). With a maximum value of 1.
GGA-208 has an accuracy of 81, so at 150m with 125 firing stability, that equates to a factor of about 25%.
So that means that 150m, something with a firing accuracy of 81 should only hit about 25% of the time. That number on 199 firing stability arms rises to 40%.