All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros Groups
log1m_inv_logit.hpp
Go to the documentation of this file.
#ifndef STAN_MATH_PRIM_SCAL_FUN_LOG1M_INV_LOGIT_HPP
#define STAN_MATH_PRIM_SCAL_FUN_LOG1M_INV_LOGIT_HPP
#include <boost/math/tools/promotion.hpp>
namespace stan {
namespace math {
template <typename T>
inline typename boost::math::tools::promote_args<T>::type
log1m_inv_logit(const T u) {
using std::exp;
if (u > 0.0)
return -u - log1p(exp(-u)); // prevent underflow
return -log1p(exp(u));
}
}
}
#endif
stan::math::log1m_inv_logit
fvar< T > log1m_inv_logit(const fvar< T > &x)
Definition: log1m_inv_logit.hpp:15
stan::math::exp
fvar< T > exp(const fvar< T > &x)
Definition: exp.hpp:10
stan::math::log1p
fvar< T > log1p(const fvar< T > &x)
Definition: log1p.hpp:16

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