1 #ifndef STAN__MATH__FUNCTIONS__LOG1P_HPP
2 #define STAN__MATH__FUNCTIONS__LOG1P_HPP
5 #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;
boost::math::tools::promote_args< T >::type log1p(const T x)
Return the natural logarithm of one plus the specified value.
Eigen::Matrix< T, Rows, Cols > log(const Eigen::Matrix< T, Rows, Cols > &m)
Return the element-wise logarithm of the matrix or vector.
double e()
Return the base of the natural logarithm.
fvar< T > log(const fvar< T > &x)