I don't know from where you got those formulae Obi, but the HP one is wrong for sure (I tried it).

The correct formula is (correct for ALL stats, including HP):

Stat = (((2 * Base + IV + (EV / 4)) * Level / 100) + Num) * Mod

where

Base is your base stat

IV is the IV of that stat

EV is the EV of that stat

Level is your level

Mod is 1.1 if stat has beneficial nature, 0.9 if stat has hindering nature, 1 otherwise

Num is Level+10 if stat is HP, 5 otherwise

Make sure you round down the number you get after every calculation that gives you a decimal.