ChanceToHit = 0.5 ^ ((((Transversal speed/(Range to target * Turret Tracking))*(Turret Signature Resolution / Target Signature Radius))^2) + ((max(0, Range to target - Turret Optimal Range))/Turret Falloff)^2)

Note: max( a,b ) is a function that returns the greater of two values.
Note that ChanceToHit is a number between 0 and 1, and is primarly determined by Transversal Speed and Range To Target.
EVE tests ChanceToHit for each individual shot made by a gun turret against X, where X is a random number also between 0 and 1, e.g. 0.765321, generated by the EVE server for each shot.
If X < ChanceToHit, the shot is a hit. If X > ChanceToHit, the shot is a miss or zero damage is applied.
X also determines the quality of a hit. If X < 0.01, then the Quality Of Hit multiplier = 3. (i.e. a 'Wrecking' shot) If X > 0.01 the Quality Of Hit multiplier = X + 0.5
ChanceToHit, essentially, specifies an interval in which values of X can fall that qualify or disqualify a hit. The larger this interval, the larger the values X can take, and hence the larger the hit multiplier (i.e. X + 0.5) can be.
For example: A shot with ChanceToHit = 0.97 X = 0.980, the shot misses. X = 0.541, the shot hits, with a damage multiplier= 1.041. X = 0.001, the shot hits, 'wrecking' with damage multiplier = 3.