added NaN testing framework for agrad/rev/functions
added NaN test for Phi_approx
updated NaN test for agrad/rev/Phi_approx