1 #ifndef STAN_MATH_PRIM_SCAL_FUN_LOG1P_HPP
2 #define STAN_MATH_PRIM_SCAL_FUN_LOG1P_HPP
4 #include <boost/math/tools/promotion.hpp>
38 inline typename boost::math::tools::promote_args<T>::type
42 return std::numeric_limits<double>::quiet_NaN();
44 if (x > 1
e-9 || x < -1
e-9)
46 else if (x > 1
e-16 || x < -1
e-16)
47 return x - 0.5 * x * x;
61 return log1p(static_cast<double>(x));
fvar< T > log(const fvar< T > &x)
double e()
Return the base of the natural logarithm.
fvar< T > log1p(const fvar< T > &x)