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 <stan/math/prim/scal/fun/log1p.hpp>
#include <cmath>
namespace stan {
namespace math {
inline double log1m_inv_logit(double u) {
using std::exp;
if (u > 0.0)
return -u - log1p(exp(-u)); // prevent underflow
return -log1p(exp(u));
}
inline double log1m_inv_logit(int u) {
return log1m_inv_logit(static_cast<double>(u));
}
}
}
#endif
stan::math::log1m_inv_logit
fvar< T > log1m_inv_logit(const fvar< T > &x)
Return the natural logarithm of one minus the inverse logit of the specified argument.
Definition: log1m_inv_logit.hpp:21
stan
Definition: log_sum_exp.hpp:8
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:11
log1p.hpp

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