updated NaN testing framework for Phi
updated NaN testing framework for Phi

stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/math,stan-dev/stan,stan-dev/math,stan-dev/math,stan-dev/stan,stan-dev/math,stan-dev/stan,stan-dev/math,stan-dev/stan,stan-dev/math,stan-dev/stan