The below calcs have been simplified from the game code, please let the game dev know if you see any obvious math errors!

Hero DPS Edit

The DPS calculation for a single hero is:

dps = Ceiling((heroCost/10) * (1-0.285f)^(heroTier-2));
//multiply by level
dps *= currentHeroLevel;
//multiply by hero skills modifier
dps *= heroDamageMultiplier;
//multiply by level multiplier 
dps *= DPSMultiplierForHeroLevel;
//multiply by number of valor points
dps *= 1+(heroValorPoints * 0.01f);

heroTier is the order of the heroes, starting from Tapps = 1, Chompy = 2 etc. This can be calculated by:

heroTier = 1+(levelHeroUnlockedAt/5);

heroCost is calculated by:

//HP for monster at level hero unlocks at
HPForMonsterAtLevelHeroUnlocked = 10*(1.7 ^ levelHeroUnlockedAt-1);
//gold for monster given this hp
goldForMonsterAtHeroUnlockedLevel = HPForMonsterAtLevelHeroUnlocked/15;
//heroCost base cost is the same as the gold dropped by a monster at the same level 
heroCost = goldForMonsterAtHeroUnlockedLevel;
//multiply cost as hero tier increases
heroCost *= 1.3 ^ heroTier-1;

heroDamageMultiplier is simply the +damage skills multiplied together. DPSMultiplierForHeroLevel is 4x every 25 levels from 200 onwards. at 1000 level steps there are special DPS bonuses (10/100/1000 for 1/2k/3k-onward)

Global DPS Edit

Global DPS is given by adding all the individual hero DPS then multiplying it by a global DPS multiplier:

GlobalDPSMultiplier = 1;
//multiply by achievement DPS boost
GlobalDPSMultiplier *= AchievementsDPSMultiplier;
//multiply by number of active infinity tokens and guardian power
GlobalDPSMultiplier *= 1+(ActiveInfinityTokens/10f)+TrainHeroesBenefit; 
//add player rank dps
GlobalDPSMultiplier *= HeroController.Instance.RankDPSMultiplier;
//add spell dps (from the spell Strange Brew)
GlobalDPSMultiplier *= SpellsController.Instance.SpellDPSMultiplier;
//add any benefit from leveling Tapps
GlobalDPSMultiplier *= TappsDPSMultipler;
//apply idle dps multiplier if active
GlobalDPSMultiplier *= 1+idlePowerBenefit;

//total DPS is the number you see on the UI
totalDPS = allHeroDPS * GlobalDPSMultiplier;

Rank DPS benefits are explained in the Ascension page. AchievementsDPSMultiplier is found by multiplying all the Achievement DPS bonuses together.