1 # ifndef CPPAD_CORE_ERF_HPP
2 # define CPPAD_CORE_ERF_HPP
73 # include <cppad/configure.hpp>
74 # if ! CPPAD_USE_CPLUSPLUS_2011
80 Type erf_template(
const Type &x)
82 const Type a =
static_cast<Type
>(993./880.);
83 const Type b =
static_cast<Type
>(89./880.);
85 return tanh( (a + b * x * x) * x );
88 inline float erf(
const float &x)
89 {
return erf_template(x); }
91 inline double erf(
const double &x)
92 {
return erf_template(x); }
95 inline AD<Base>
erf(
const AD<Base> &x)
96 {
return erf_template(x); }
99 inline AD<Base>
erf(
const VecAD_reference<Base> &x)
100 {
return erf_template( x.ADBase() ); }
105 # endif // CPPAD_USE_CPLUSPLUS_2011
106 # endif // CPPAD_ERF_INCLUDED
std::complex< double > erf(const std::complex< double > &x)
AD< Base > exp(const AD< Base > &x)
AD< Base > tanh(const AD< Base > &x)