1#ifndef STAN_MATH_REV_FUN_ACOS_HPP
2#define STAN_MATH_REV_FUN_ACOS_HPP
57 x.adj() -= vi.adj() / std::sqrt(1.0 - (x.val() * x.val()));
68template <
typename VarMat, require_var_matrix_t<VarMat>* =
nullptr>
69inline auto acos(
const VarMat& x) {
71 x.val().array().acos().matrix(), [x](
const auto& vi)
mutable {
73 -= vi.adj().array() / (1.0 - (x.val().array().square())).sqrt();
83inline std::complex<var>
acos(
const std::complex<var>& x) {
std::complex< V > complex_acos(const std::complex< V > &x)
Return the arc cosine of the complex argument.
fvar< T > acos(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 ...