variances are matched between the binomial and the normal approximation.
This is assuming that np and nq are large.
The lower formula looks to use a better approximation, and so have a wider
range of validity.
Now I would expect that the lower formula might be used in software packages,
but for hand calculation I would use the upper formula unless
np and or nq are small, then I suspect I would use the bootstrap or the
exact binomial calculations.