1#ifndef STAN_MATH_REV_PROB_STD_NORMAL_LOG_QF_HPP
2#define STAN_MATH_REV_PROB_STD_NORMAL_LOG_QF_HPP
20template <
typename T, require_stan_scalar_or_eigen_t<T>* =
nullptr>
24 auto vi_array = as_array_or_scalar(vi.val());
25 auto vi_sign = sign(as_array_or_scalar(vi.adj()));
27 const auto& deriv = as_array_or_scalar(log_p).val()
28 + log(as_array_or_scalar(vi.adj()) * vi_sign)
29 - NEG_LOG_SQRT_TWO_PI + 0.5 * square(vi_array);
30 as_array_or_scalar(log_p).adj() += vi_sign * exp(deriv);
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 > std_normal_log_qf(const fvar< T > &p)
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...