1#ifndef STAN_MATH_PRIM_FUN_INV_LOGIT_HPP
2#define STAN_MATH_PRIM_FUN_INV_LOGIT_HPP
53 double exp_a = std::exp(a);
57 return exp_a / (1.0 + exp_a);
59 return inv(1 + std::exp(-a));
71 static inline auto fun(T&& x) {
83template <
typename Container, require_ad_container_t<Container>* =
nullptr,
84 require_all_not_nonscalar_prim_or_rev_kernel_expression_t<
85 Container>* =
nullptr,
86 require_not_rev_matrix_t<Container>* =
nullptr>
89 std::forward<Container>(x));
102template <
typename Container,
105 Container>* =
nullptr>
108 std::forward<Container>(x),
109 [](
const auto& v) {
return v.array().logistic(); });
require_t< container_type_check_base< is_container, base_type_t, TypeCheck, Check... > > require_container_bt
Require type satisfies is_container.
require_all_not_t< is_nonscalar_prim_or_rev_kernel_expression< std::decay_t< Types > >... > require_all_not_nonscalar_prim_or_rev_kernel_expression_t
Require none of the types satisfy is_nonscalar_prim_or_rev_kernel_expression.
const double LOG_EPSILON
The natural logarithm of machine precision , .
fvar< T > inv_logit(const fvar< T > &x)
Returns the inverse logit function applied to the argument.
fvar< T > inv(const fvar< T > &x)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Base template class for vectorization of unary scalar functions defined by a template class F to a sc...
Structure to wrap inv_logit() so that it can be vectorized.