1#ifndef STAN_MATH_REV_FUN_TAN_HPP
2#define STAN_MATH_REV_FUN_TAN_HPP
49 a.adj() += vi.adj() * (1.0 + vi.val() * vi.val());
61template <
typename VarMat, require_var_matrix_t<VarMat>* =
nullptr>
62inline auto tan(
const VarMat& a) {
64 [a](
const auto& vi)
mutable {
65 a.adj() += vi.adj().cwiseProduct(
66 (1.0 + vi.val().array().square()).matrix());
76inline std::complex<var>
tan(
const std::complex<var>& z) {
std::complex< V > complex_tan(const std::complex< V > &z)
Return the tangent of the complex argument.
var_value< plain_type_t< T > > make_callback_var(T &&value, F &&functor)
Creates a new var initialized with a callback_vari with a given value and reverse-pass callback funct...
fvar< T > tan(const fvar< T > &x)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...