Stan Math Library  2.20.0
reverse mode automatic differentiation
Phi_approx.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_PRIM_SCAL_FUN_PHI_APPROX_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_PHI_APPROX_HPP
3 
6 #include <cmath>
7 
8 namespace stan {
9 namespace math {
10 
22 inline double Phi_approx(double x) {
23  using std::pow;
24  return inv_logit(0.07056 * pow(x, 3.0) + 1.5976 * x);
25 }
26 
34 inline double Phi_approx(int x) { return Phi_approx(static_cast<double>(x)); }
35 
36 } // namespace math
37 } // namespace stan
38 
39 #endif
fvar< T > inv_logit(const fvar< T > &x)
Returns the inverse logit function applied to the argument.
Definition: inv_logit.hpp:20
fvar< T > Phi_approx(const fvar< T > &x)
Return an approximation of the unit normal cumulative distribution function (CDF).
Definition: Phi_approx.hpp:23
fvar< T > pow(const fvar< T > &x1, const fvar< T > &x2)
Definition: pow.hpp:16

     [ Stan Home Page ] © 2011–2018, Stan Development Team.