All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
Phi.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_FWD_SCAL_FUN_PHI_HPP
#define STAN_MATH_FWD_SCAL_FUN_PHI_HPP
#include <stan/math/fwd/core.hpp>
#include <stan/math/prim/scal/fun/Phi.hpp>
#include <stan/math/prim/scal/fun/constants.hpp>
namespace stan {
namespace math {
template <typename T>
inline fvar<T> Phi(const fvar<T>& x) {
using stan::math::Phi;
using std::exp;
using std::sqrt;
T xv = x.val_;
return fvar<T>(Phi(xv),
x.d_ * exp(xv * xv / -2.0) / sqrt(2.0 * stan::math::pi()));
}
}
}
#endif
core.hpp
stan::math::fvar::d_
T d_
Definition: fvar.hpp:15
stan::math::sqrt
fvar< T > sqrt(const fvar< T > &x)
Definition: sqrt.hpp:15
stan::math::fvar::val_
T val_
Definition: fvar.hpp:14
stan::math::exp
fvar< T > exp(const fvar< T > &x)
Definition: exp.hpp:10
stan::math::Phi
fvar< T > Phi(const fvar< T > &x)
Definition: Phi.hpp:14
constants.hpp
stan::math::pi
double pi()
Return the value of pi.
Definition: constants.hpp:86
Phi.hpp
stan::math::fvar
Definition: fvar.hpp:13

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