1#ifndef STAN_MATH_REV_FUN_SIN_HPP
2#define STAN_MATH_REV_FUN_SIN_HPP
48 a.adj() += vi.adj() * std::cos(a.val());
59template <
typename VarMat, require_var_matrix_t<VarMat>* =
nullptr>
60inline auto sin(
const VarMat& a) {
62 a.val().array().sin().matrix(), [a](
const auto& vi)
mutable {
63 a.adj() += vi.adj().cwiseProduct(a.val().array().cos().matrix());
73inline std::complex<var>
sin(
const std::complex<var>& z) {
std::complex< V > complex_sin(const std::complex< V > &z)
Return the sine of the complex argument.
fvar< T > sin(const fvar< T > &x)
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...
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...