Hardly see someone so meticulous to calcs. I'd love to hear if you could give a replay or screenshot of inaccuracies in PS, and compare it with your own equations. It would greatly improve your credibility.
Here's the one the simulator uses: http://pokemonshowdown.com/damagecalc/
Here's the one the simulator uses: http://pokemonshowdown.com/damagecalc/