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>
20inline fvar<T> inv_logit(const fvar<T>& x) {
21 using std::exp;
22 using std::pow;
23 return fvar<T>(inv_logit(x.val_),
24 x.d_ * inv_logit(x.val_) * (1 - inv_logit(x.val_)));
25}
26
27} // namespace math
28} // namespace stan
29#endif
fvar< T > inv_logit(const fvar< 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 ...
Scalar val_
The value of this variable.
Definition fvar.hpp:49
Scalar d_
The tangent (derivative) of this variable.
Definition fvar.hpp:61
This template class represents scalars used in forward-mode automatic differentiation,...
Definition fvar.hpp:40