1#ifndef STAN_MATH_REV_FUN_CBRT_HPP
2#define STAN_MATH_REV_FUN_CBRT_HPP
39 a.adj() += vi.adj() / (3.0 * vi.val() * vi.val());
49template <
typename VarMat, require_var_matrix_t<VarMat>* =
nullptr>
50inline auto cbrt(
const VarMat& a) {
52 a.val().unaryExpr([](
const auto x) { return cbrt(x); }),
53 [a](
const auto& vi)
mutable {
54 a.adj().array() += vi.adj().array() / (3.0 * vi.val().array().square());
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 > cbrt(const fvar< T > &x)
Return cube root of specified argument.
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...