Automatic Differentiation
 
Loading...
Searching...
No Matches
inv_logit.hpp
Go to the documentation of this file.
1#ifndef STAN_MATH_FWD_FUN_INV_LOGIT_HPP
2#define STAN_MATH_FWD_FUN_INV_LOGIT_HPP
3
7#include <cmath>
8
9namespace stan {
10namespace math {
11
19template <typename T, require_fvar_t<T>* = nullptr>
20inline auto inv_logit(T&& x) {
21 return std::decay_t<T>(inv_logit(x.val_),
22 x.d_ * inv_logit(x.val_) * (1 - inv_logit(x.val_)));
23}
24
25} // namespace math
26} // namespace stan
27#endif
auto inv_logit(T &&x)
Returns the inverse logit function applied to the argument.
Definition inv_logit.hpp:20
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...