Ok more and better formula. I fixed another bug happeng when summing stuff around the cap value, doesn't really matther what is is but It's more accurate. My formula are now bigger but account for when critrate will cap at 100 (like in abyssea) and also consider different possible cap values for +critdmg% and + crit% like when you are in abyssea with 75% base crit rate and 30% crit damage. I'm too lazy to build such formula for low values of N like previously so all the following formula are valid as long as N>50.

Let N=number of swings while impetus is up.

a=accuracy rate (0.95 for instance)

c=base crit%,d=base critdmg%

cap1=min(50+c,100) the crit% bonus cap

cap2=min(50+d,100) the critdmg% bonus cap

lambda1=cap1-c the minimal #hits to reach the cap crit% bonus

lambda2=cap2-d the minimal #hits to reach the cap crit% bonus

**critical % average formula**

this includes base crit rate and gives the value between 0 and 100.

Code:

crit%=(c+(lambda1+1)*(-c+a*c-a)/(-1+a)+1/(-1+a)*(-(-c+a*c-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)/(-1+a)+a^(lambda1+1)*(lambda1+1+c))-1/(-1+a)*(-(-c+a*c-1)*a/(-1+a)+a*(1+c))-(-c+a*c-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)/(-1+a)+a^(lambda1+1)*cap1+(N-2-lambda1)*(-(-c+a*c-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)/(-1+a)+(-c+a*c-a)/(-1+a)+a^(lambda1+1)*cap1))/N

**criticaldamage % average formula**

this includes base crit damage % and gives the value between 0 and 100.

If lambda2<=lambda1

Code:

critdmg%=(c*d+(lambda2+1)*(a+a^2-a^2*c-a^2*d+a*d+a*c-2*c*d*a+c*d*a^2+c*d)/(-1+a)^2+(a*d+a*c-3*a+2*(lambda2+1)*a-3-c-d-2*lambda2)/(-3-a+a*c+a*d-d-c-2*lambda2+2*(lambda2+1)*a)/(-1+a)*(-(a+(lambda2+1)^2+a^2+2*(lambda2+1)*a-a^2*c-2*(lambda2+1)^2*a+(lambda2+1)^2*a^2-2*(lambda2+1)*a^2-a^2*d+c*(lambda2+1)+a*d+a*c+d*(lambda2+1)-2*c*d*a+c*d*a^2-2*d*(lambda2+1)*a-2*c*(lambda2+1)*a+a^2*d*(lambda2+1)+a^2*c*(lambda2+1)+c*d)*a^(lambda2+1)/(-1+a)^2+a^(lambda2+1)*(lambda2+1+c)*(lambda2+1+d))+(a+a^2-a^2*c-a^2*d+a*d+a*c-2*c*d*a+c*d*a^2+c*d)/(-1+a)^2-(a*d+a*c-a-3-c-d)/(a*d+a*c-c-d-3+a)/(-1+a)*(-(a+c+d-a*d-2*c*d*a+1+c*d*a^2-a*c+c*d)*a/(-1+a)^2+a*(1+c)*(1+d))-2*(a+(lambda2+1)^2+a^2+2*(lambda2+1)*a-a^2*c-2*(lambda2+1)^2*a+(lambda2+1)^2*a^2-2*(lambda2+1)*a^2-a^2*d+c*(lambda2+1)+a*d+a*c+d*(lambda2+1)-2*c*d*a+c*d*a^2-2*d*(lambda2+1)*a-2*c*(lambda2+1)*a+a^2*d*(lambda2+1)+a^2*c*(lambda2+1)+c*d)*a^(lambda2+1)/(-1+a)^2+a^(lambda2+1)*(lambda2+1+c)*cap2+1/(-1+a)*(-(-c+a*c-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)*cap2/(-1+a)+a^(lambda1+1)*(lambda1+1+c)*cap2)+(lambda1+1)*(-(a+(lambda2+1)^2+a^2+2*(lambda2+1)*a-a^2*c-2*(lambda2+1)^2*a+(lambda2+1)^2*a^2-2*(lambda2+1)*a^2-a^2*d+c*(lambda2+1)+a*d+a*c+d*(lambda2+1)-2*c*d*a+c*d*a^2-2*d*(lambda2+1)*a-2*c*(lambda2+1)*a+a^2*d*(lambda2+1)+a^2*c*(lambda2+1)+c*d)*a^(lambda2+1)/(-1+a)^2+(-c+a*c-lambda2-1+(lambda2+1)*a-a)*a^(lambda2+1)*cap2/(-1+a)+(a+a^2-a^2*c-a^2*d+a*d+a*c-2*c*d*a+c*d*a^2+c*d)/(-1+a)^2)-1/(-1+a)*(-(-c+a*c-lambda2-2+(lambda2+2)*a-a)*a^(lambda2+2)*cap2/(-1+a)+a^(lambda2+2)*(lambda2+2+c)*cap2)-(lambda2+2)*(-(a+(lambda2+1)^2+a^2+2*(lambda2+1)*a-a^2*c-2*(lambda2+1)^2*a+(lambda2+1)^2*a^2-2*(lambda2+1)*a^2-a^2*d+c*(lambda2+1)+a*d+a*c+d*(lambda2+1)-2*c*d*a+c*d*a^2-2*d*(lambda2+1)*a-2*c*(lambda2+1)*a+a^2*d*(lambda2+1)+a^2*c*(lambda2+1)+c*d)*a^(lambda2+1)/(-1+a)^2+(-c+a*c-lambda2-1+(lambda2+1)*a-a)*a^(lambda2+1)*cap2/(-1+a)+(a+a^2-a^2*c-a^2*d+a*d+a*c-2*c*d*a+c*d*a^2+c*d)/(-1+a)^2)-(-c+a*c-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)*cap2/(-1+a)+(-c+a*c-lambda2-1+(lambda2+1)*a-a)*a^(lambda2+1)*cap2/(-1+a)+a^(lambda1+1)*cap1*cap2+(N-2-lambda1)*(-(a+(lambda2+1)^2+a^2+2*(lambda2+1)*a-a^2*c-2*(lambda2+1)^2*a+(lambda2+1)^2*a^2-2*(lambda2+1)*a^2-a^2*d+c*(lambda2+1)+a*d+a*c+d*(lambda2+1)-2*c*d*a+c*d*a^2-2*d*(lambda2+1)*a-2*c*(lambda2+1)*a+a^2*d*(lambda2+1)+a^2*c*(lambda2+1)+c*d)*a^(lambda2+1)/(-1+a)^2+(a+a^2-a^2*c-a^2*d+a*d+a*c-2*c*d*a+c*d*a^2+c*d)/(-1+a)^2-(-c+a*c-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)*cap2/(-1+a)+(-c+a*c-lambda2-1+(lambda2+1)*a-a)*a^(lambda2+1)*cap2/(-1+a)+a^(lambda1+1)*cap1*cap2))/(c+(lambda1+1)*(-c+a*c-a)/(-1+a)+1/(-1+a)*(-(-c+a*c-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)/(-1+a)+a^(lambda1+1)*(lambda1+1+c))-1/(-1+a)*(-(-c+a*c-1)*a/(-1+a)+a*(1+c))-(-c+a*c-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)/(-1+a)+a^(lambda1+1)*cap1+(N-2-lambda1)*(-(-c+a*c-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)/(-1+a)+(-c+a*c-a)/(-1+a)+a^(lambda1+1)*cap1))

if lambda1=lambda2

Code:

critdmg%=(c*d+(lambda2+1)*(a-a^2*c-a^2*d+a*c+a*d-2*c*d*a+c*d*a^2+a^2+c*d)/(-1+a)^2+(a*d-3*a+2*(lambda2+1)*a+a*c-d-3-2*lambda2-c)/(-3+a*c+a*d-c-d-a+2*(lambda2+1)*a-2*lambda2)/(-1+a)*(-(a+2*(lambda2+1)*a-a^2*c-a^2*d+c*(lambda2+1)+d*(lambda2+1)+a*c+a*d-2*(lambda2+1)^2*a+(lambda2+1)^2*a^2-2*(lambda2+1)*a^2-2*c*d*a+c*d*a^2-2*d*(lambda2+1)*a-2*c*(lambda2+1)*a+a^2*d*(lambda2+1)+a^2*c*(lambda2+1)+(lambda2+1)^2+a^2+c*d)*a^(lambda2+1)/(-1+a)^2+a^(lambda2+1)*(lambda2+1+c)*(lambda2+1+d))-(a*d-a+a*c-d-3-c)/(-3+a*c+a*d-c-d+a)/(-1+a)*(-(a+c+d-2*c*d*a-a*d+1-a*c+c*d+c*d*a^2)*a/(-1+a)^2+a*(1+c)*(1+d))-(a+2*(lambda2+1)*a-a^2*c-a^2*d+c*(lambda2+1)+d*(lambda2+1)+a*c+a*d-2*(lambda2+1)^2*a+(lambda2+1)^2*a^2-2*(lambda2+1)*a^2-2*c*d*a+c*d*a^2-2*d*(lambda2+1)*a-2*c*(lambda2+1)*a+a^2*d*(lambda2+1)+a^2*c*(lambda2+1)+(lambda2+1)^2+a^2+c*d)*a^(lambda2+1)/(-1+a)^2+a^(lambda2+1)*cap2*cap1+(N-2-lambda2)*(-(a+2*(lambda2+1)*a-a^2*c-a^2*d+c*(lambda2+1)+d*(lambda2+1)+a*c+a*d-2*(lambda2+1)^2*a+(lambda2+1)^2*a^2-2*(lambda2+1)*a^2-2*c*d*a+c*d*a^2-2*d*(lambda2+1)*a-2*c*(lambda2+1)*a+a^2*d*(lambda2+1)+a^2*c*(lambda2+1)+(lambda2+1)^2+a^2+c*d)*a^(lambda2+1)/(-1+a)^2+(a-a^2*c-a^2*d+a*c+a*d-2*c*d*a+c*d*a^2+a^2+c*d)/(-1+a)^2+a^(lambda2+1)*cap2*cap1))/(c+(lambda1+1)*(-c+a*c-a)/(-1+a)+1/(-1+a)*(-(-c+a*c-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)/(-1+a)+a^(lambda1+1)*(lambda1+1+c))-1/(-1+a)*(-(-c+a*c-1)*a/(-1+a)+a*(1+c))-(-c+a*c-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)/(-1+a)+a^(lambda1+1)*cap1+(N-2-lambda1)*(-(-c+a*c-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)/(-1+a)+(-c+a*c-a)/(-1+a)+a^(lambda1+1)*cap1))

if lambda2>lambda1

Code:

critdmg%=(c*d+(lambda1+1)*(a+a^2-a^2*c-a^2*d+a*d+a*c-2*c*d*a+c*d*a^2+c*d)/(-1+a)^2+(a*c+a*d-3*a+2*(lambda1+1)*a-3-d-c-2*lambda1)/(-3-a+a*d+a*c-c-d-2*lambda1+2*(lambda1+1)*a)/(-1+a)*(-(a+(lambda1+1)^2+a^2+2*(lambda1+1)*a-a^2*d-2*(lambda1+1)^2*a+(lambda1+1)^2*a^2-2*(lambda1+1)*a^2-a^2*c+d*(lambda1+1)+a*c+a*d+c*(lambda1+1)-2*c*d*a+c*d*a^2-2*c*(lambda1+1)*a-2*d*(lambda1+1)*a+a^2*c*(lambda1+1)+a^2*d*(lambda1+1)+c*d)*a^(lambda1+1)/(-1+a)^2+a^(lambda1+1)*(lambda1+1+d)*(lambda1+1+c))+(a+a^2-a^2*c-a^2*d+a*d+a*c-2*c*d*a+c*d*a^2+c*d)/(-1+a)^2-(a*d+a*c-a-3-c-d)/(a*d+a*c-c-d-3+a)/(-1+a)*(-(a+c+d-a*d-2*c*d*a+1+c*d*a^2-a*c+c*d)*a/(-1+a)^2+a*(1+c)*(1+d))-2*(a+(lambda1+1)^2+a^2+2*(lambda1+1)*a-a^2*d-2*(lambda1+1)^2*a+(lambda1+1)^2*a^2-2*(lambda1+1)*a^2-a^2*c+d*(lambda1+1)+a*c+a*d+c*(lambda1+1)-2*c*d*a+c*d*a^2-2*c*(lambda1+1)*a-2*d*(lambda1+1)*a+a^2*c*(lambda1+1)+a^2*d*(lambda1+1)+c*d)*a^(lambda1+1)/(-1+a)^2+a^(lambda1+1)*(lambda1+1+d)*cap1+1/(-1+a)*(-(-d+a*d-lambda2-1+(lambda2+1)*a-a)*a^(lambda2+1)*cap1/(-1+a)+a^(lambda2+1)*(lambda2+1+d)*cap1)+(lambda2+1)*(-(a+(lambda1+1)^2+a^2+2*(lambda1+1)*a-a^2*d-2*(lambda1+1)^2*a+(lambda1+1)^2*a^2-2*(lambda1+1)*a^2-a^2*c+d*(lambda1+1)+a*c+a*d+c*(lambda1+1)-2*c*d*a+c*d*a^2-2*c*(lambda1+1)*a-2*d*(lambda1+1)*a+a^2*c*(lambda1+1)+a^2*d*(lambda1+1)+c*d)*a^(lambda1+1)/(-1+a)^2+(-d+a*d-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)*cap1/(-1+a)+(a+a^2-a^2*c-a^2*d+a*d+a*c-2*c*d*a+c*d*a^2+c*d)/(-1+a)^2)-1/(-1+a)*(-(-d+a*d-lambda1-2+(lambda1+2)*a-a)*a^(lambda1+2)*cap1/(-1+a)+a^(lambda1+2)*(lambda1+2+d)*cap1)-(lambda1+2)*(-(a+(lambda1+1)^2+a^2+2*(lambda1+1)*a-a^2*d-2*(lambda1+1)^2*a+(lambda1+1)^2*a^2-2*(lambda1+1)*a^2-a^2*c+d*(lambda1+1)+a*c+a*d+c*(lambda1+1)-2*c*d*a+c*d*a^2-2*c*(lambda1+1)*a-2*d*(lambda1+1)*a+a^2*c*(lambda1+1)+a^2*d*(lambda1+1)+c*d)*a^(lambda1+1)/(-1+a)^2+(-d+a*d-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)*cap1/(-1+a)+(a+a^2-a^2*c-a^2*d+a*d+a*c-2*c*d*a+c*d*a^2+c*d)/(-1+a)^2)-(-d+a*d-lambda2-1+(lambda2+1)*a-a)*a^(lambda2+1)*cap1/(-1+a)+(-d+a*d-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)*cap1/(-1+a)+a^(lambda2+1)*cap2*cap1+(N-2-lambda2)*(-(a+(lambda1+1)^2+a^2+2*(lambda1+1)*a-a^2*d-2*(lambda1+1)^2*a+(lambda1+1)^2*a^2-2*(lambda1+1)*a^2-a^2*c+d*(lambda1+1)+a*c+a*d+c*(lambda1+1)-2*c*d*a+c*d*a^2-2*c*(lambda1+1)*a-2*d*(lambda1+1)*a+a^2*c*(lambda1+1)+a^2*d*(lambda1+1)+c*d)*a^(lambda1+1)/(-1+a)^2+(a+a^2-a^2*c-a^2*d+a*d+a*c-2*c*d*a+c*d*a^2+c*d)/(-1+a)^2-(-d+a*d-lambda2-1+(lambda2+1)*a-a)*a^(lambda2+1)*cap1/(-1+a)+(-d+a*d-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)*cap1/(-1+a)+a^(lambda2+1)*cap2*cap1))/(c+(lambda1+1)*(-c+a*c-a)/(-1+a)+1/(-1+a)*(-(-c+a*c-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)/(-1+a)+a^(lambda1+1)*(lambda1+1+c))-1/(-1+a)*(-(-c+a*c-1)*a/(-1+a)+a*(1+c))-(-c+a*c-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)/(-1+a)+a^(lambda1+1)*cap1+(N-2-lambda1)*(-(-c+a*c-lambda1-1+(lambda1+1)*a-a)*a^(lambda1+1)/(-1+a)+(-c+a*c-a)/(-1+a)+a^(lambda1+1)*cap1))

It matches the simulations in abyssea type environnement so it looks good.

Here is some comparison formula/ simulation

Code:

N=144 hit, c=10%,d=0%
C simulation : 15.5961% crit bonus, 23.3031% critdmg bonus
formula : 15.60982892 and 23.31883956
N=144 hit, c=0%,d=0%
C simulation : 15.6092% and 28.2490%
formula : 15.60982892 and 28.25740146
N=144 hit, c=30%,d=0%
C simulation : 15.5997% and 19.9192%
formula : 15.60982892 and 19.93842317
c=30%,d=10%,N=300
my simulation : 16.6087% crit bonus, 21.2273% critdmg bonus
formula : 16.61250153 21.23356775
c=75%,d=30%,N=300 (abyssea, RR,GH,SS and cruor buff)
my simulation : 13.2522% crit bonus, 17.9836% critdmg bonus
formula : 13.25349170 and 17.99390912
c=59%, d=81%, N=300(imaginary)
my simulation : 15.8729% crit bonus, 12.5893% critdmg bonus
formula : 15.88534993 and 12.59230677