Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
erf.hpp
Go to the documentation of this file.
1 #ifndef STAN__AGRAD__FWD__FUNCTIONS__ERF_HPP
2 #define STAN__AGRAD__FWD__FUNCTIONS__ERF_HPP
3 
5 #include <stan/meta/traits.hpp>
6 #include <math.h>
9 
10 namespace stan {
11 
12  namespace agrad {
13 
14  template <typename T>
15  inline
16  fvar<T>
17  erf(const fvar<T>& x) {
21  using stan::math::square;
22  return fvar<T>(erf(x.val_), x.d_ * exp(-square(x.val_))
24  }
25  }
26 }
27 #endif
T square(const T x)
Return the square of the specified argument.
Definition: square.hpp:22
var erf(const stan::agrad::var &a)
The error function for variables (C99).
Definition: erf.hpp:63
fvar< T > erf(const fvar< T > &x)
Definition: erf.hpp:17
fvar< T > square(const fvar< T > &x)
Definition: square.hpp:15
const double TWO_OVER_SQRT_PI
Definition: constants.hpp:146
fvar< T > sqrt(const fvar< T > &x)
Definition: sqrt.hpp:15
fvar< T > exp(const fvar< T > &x)
Definition: exp.hpp:16

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