1 #ifndef STAN_MATH_REV_SCAL_FUN_TANH_HPP
2 #define STAN_MATH_REV_SCAL_FUN_TANH_HPP
11 class tanh_vari :
public op_v_vari {
13 explicit tanh_vari(vari* avi) :
14 op_v_vari(
std::
tanh(avi->val_), avi) {
18 avi_->adj_ += adj_ / (cosh *
cosh);
51 return var(
new tanh_vari(a.
vi_));
fvar< T > cosh(const fvar< T > &x)
Independent (input) and dependent (output) variables for gradients.
vari * vi_
Pointer to the implementation of this variable.
fvar< T > tanh(const fvar< T > &x)