Stan Math Library  2.20.0
reverse mode automatic differentiation
logit.hpp
Go to the documentation of this file.
1 #ifndef STAN_MATH_REV_SCAL_FUN_LOGIT_HPP
2 #define STAN_MATH_REV_SCAL_FUN_LOGIT_HPP
3 
4 #include <stan/math/rev/meta.hpp>
6 #include <stan/math/rev/core.hpp>
8 
9 namespace stan {
10 namespace math {
11 
18 inline var logit(const var& u) {
19  return var(new precomp_v_vari(logit(u.val()), u.vi_,
20  1 / (u.val() - u.val() * u.val())));
21 }
22 
23 } // namespace math
24 } // namespace stan
25 #endif
Independent (input) and dependent (output) variables for gradients.
Definition: var.hpp:33
vari * vi_
Pointer to the implementation of this variable.
Definition: var.hpp:45
fvar< T > logit(const fvar< T > &x)
Definition: logit.hpp:14
double val() const
Return the value of this variable.
Definition: var.hpp:294

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