1 #ifndef STAN_MATH_FWD_SCAL_FUN_PHI_APPROX_HPP 2 #define STAN_MATH_FWD_SCAL_FUN_PHI_APPROX_HPP 3 4 #include <stan/math/fwd/core.hpp> 5 #include <stan/math/prim/scal/fun/inv_logit.hpp> 6 #include <cmath> 7 8 namespace stan { 9 namespace math { 10 11 /** 12 * Return an approximation of the unit normal cumulative 13 * distribution function (CDF). 14 * 15 * @tparam T scalar type of forward-mode autodiff variable 16 * argument. 17 * @param x argument 18 * @return approximate probability random sample is less than or 19 * equal to argument 20 */ 21 template <typename T> Phi_approx(const fvar<T> & x)22inline fvar<T> Phi_approx(const fvar<T>& x) { 23 using std::pow; 24 return inv_logit(0.07056 * pow(x, 3.0) + 1.5976 * x); 25 } 26 27 } // namespace math 28 } // namespace stan 29 #endif 30