1#ifndef STAN_MATH_REV_FUN_PHI_HPP
2#define STAN_MATH_REV_FUN_PHI_HPP
55 a.adj() += vi.adj() * INV_SQRT_TWO_PI * std::exp(-0.5 * a.val() * a.val());
66template <
typename T, require_var_matrix_t<T>* =
nullptr>
67inline auto Phi(
const T& a) {
69 a.adj().array() += vi.adj().array() * INV_SQRT_TWO_PI
70 * (-0.5 * a.val().array().square()).exp();
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 > Phi(const fvar< T > &x)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...