Short answer:
You are treating AM3 as one proc that contains 2 mutually exclusive outcomes
I am treating AM3 as two procs that contain potentially overlapping outcomes.
I will edit in the long answer shortly.
Longer answer:
I'm not one for code, but I think the difference would be like this:
How you treat it
Code
elif am3 and random() <= 0.6: if random() <= 1 / 3: hit += 2 else: hit += 1
How I treat it
Code
elif random() <= mythicta / 100: hit += 2 elif random() <= mythicda / 100: hit += 1
where mythicta and mythicda are set as variables like the gear multiattack procs are.
Logically in my model, what is happening is this:
First, Mythic TA is checked.
20% chance of Triple Attack occuring, 80% of Triple Attack not occuring.
Then, Mythic DA is checked.
Out of 100%, 20% of the time TA occurs, and within that 20% mythic DA can occur, but is discarded because TA has occurred.
That leaves the remaining 80% chance of no mythic TA.
Within that 80%, there is a 50% chance of Mythic DA occurring, which results in the observed 20/40 split.
To break it down:
Code
20% Mythic TA procs = 20% observed TA 50% of which TA only procs 50% of which both TA and DA proc 80% Mythic TA does NOT proc 50% of which DA procs 50% of which DA does not proc
This results in the observed 20% TA, 40% DA, and 40% single attack.
In practice whether you treat AM3 as one proc with split outcomes vs two procs with potentially overlapping outcomes does not matter, as long as you double check your results to confirm they actually make sense.
/edit
Also, you have the gear multiattack stats repeated, is that bit of code supposed to be modeling Insurgency, where the first set plus AM3 represents the mutiattack window of the first hit, and the second repetition represents multiattack window of the second hit, and the hit = min(7, hit) value represents the total number of slots that a proc can occur in?