It's definitely been awhile since I've read through C++ code, and I definitely didn't dig too deep, but I saw a couple of things that might merit some double checking.
When Rake initial damage is calculated, you use the following lines:
rake.adamage=((ap*0.01))*(1+fury_m)*(1+naturalist_m)*(1+mdebuff*0.3);
rake.acritdamage=(2*(1+pistinct_m)*(1+META*0.03)*((ap*0.01))*(1+fury_m)*(1+naturalist_m))*(1+mdebuff*0.3);
rake.bdamage=(190)*(1+fury_m)*(1+naturalist_m)*(1+mdebuff*0.3);
rake.bcritdamage=(2*(1+pistinct_m)*(1+META*0.03)*(190)*(1+fury_m)*(1+naturalist_m))*(1+mdebuff*0.3);
Here, you are taking into account both the base and AP modified damage and the additional effects of Primal Fury, Naturalist, and Mangle on the non-crits.
Here is the later code in which you apply it to overall damage:
//cout << "Time: " << timer/100.0 << ", Energy: " << en <<"\n";
dmg=(1+sr*src)*(1+RA*0.02)*(rake.adamage+rake.bdamage)*(1+0.3*mdebuff);
damage+=dmg;
ydamage+=dmg;
rake_damage_tot+=dmg;
rakenum++;
Here you are applying the Savage Roar modifier, Retribution Aura, and again Mangle.
Are you double dipping into the Mangle debuff here? Also, your Retribution Aura modifier is 0.02 throughout, and the buff itself is 3%, not 2%.
Last, just possibly a typo when displaying the Rake timer. It prints "Rip Timer" instead of "Rake Timer". It's commented out, but still caught my eye:
rkem++;
//cout << "Tick: " << rkem << " Rip Timer " << rake_timer/100.0 <<"\n";
damage+=dmg;
ydamage+=dmg;
I apologize if I'm completely off base with any of this. As I said, it's been awhile since I've read over C++ coding, and I'm a hobby programmer at best. Overall this looks like a great tool, and I'm excited about using it. Also, not so much a bug, but more of a curiosity... How exactly did you come upon the modifier for Primal Fury? You have fury_t set at 2 to indicate 2 points in the talent. This then gets multiplied by 0.1 for fury_m, the multiplier, resulting in a multipler of 0.2. This is then applied to the base damage of abilities, in a similar way that Naturalist is applied as a 0.1 modifier. Is Primal Fury best represented as a 20% increase to base damage? This would seem to undervalue crit and it's benefits in maintaining a cycle. Is this talent just too difficult to model in a simulator? Thanks for your time, and thanks so much for your work on this!