Reimplementation of normpdf function with correctness check.