@@ -27,9 +27,8 @@ namespace stan {
2727namespace math {
2828
2929template <typename T_y, typename T_shape, typename T_inv_scale>
30- inline return_type_t <T_y, T_shape, T_inv_scale> gamma_lccdf (const T_y& y,
31- const T_shape& alpha,
32- const T_inv_scale& beta) {
30+ inline return_type_t <T_y, T_shape, T_inv_scale> gamma_lccdf (
31+ const T_y& y, const T_shape& alpha, const T_inv_scale& beta) {
3332 using std::exp;
3433 using std::log;
3534 using T_partials_return = partials_return_t <T_y, T_shape, T_inv_scale>;
@@ -122,7 +121,8 @@ inline return_type_t<T_y, T_shape, T_inv_scale> gamma_lccdf(const T_y& y,
122121
123122 if (use_cf) {
124123 log_Qn = internal::log_q_gamma_cf (alpha_dbl, beta_y);
125- T_partials_return log_Qn_fvar = internal::log_q_gamma_cf (alpha_unit, beta_unit);
124+ T_partials_return log_Qn_fvar
125+ = internal::log_q_gamma_cf (alpha_unit, beta_unit);
126126 dlogQ_dalpha = log_Qn_fvar.d_ ;
127127 } else {
128128 const T_partials_return Pn = gamma_p (alpha_dbl, beta_y);
@@ -131,7 +131,8 @@ inline return_type_t<T_y, T_shape, T_inv_scale> gamma_lccdf(const T_y& y,
131131 if (!std::isfinite (value_of_rec (log_Qn)) && beta_y > 0.0 ) {
132132 // Fallback to continued fraction
133133 log_Qn = internal::log_q_gamma_cf (alpha_dbl, beta_y);
134- T_partials_return log_Qn_fvar = internal::log_q_gamma_cf (alpha_unit, beta_unit);
134+ T_partials_return log_Qn_fvar
135+ = internal::log_q_gamma_cf (alpha_unit, beta_unit);
135136 dlogQ_dalpha = log_Qn_fvar.d_ ;
136137 } else {
137138 T_partials_return log_Qn_fvar = log1m (gamma_p (alpha_unit, beta_unit));
@@ -156,13 +157,15 @@ inline return_type_t<T_y, T_shape, T_inv_scale> gamma_lccdf(const T_y& y,
156157 }
157158 P += log_Qn;
158159
159- constexpr bool need_y_beta_deriv = !is_constant_all<T_y, T_inv_scale>::value;
160+ constexpr bool need_y_beta_deriv
161+ = !is_constant_all<T_y, T_inv_scale>::value;
160162 if constexpr (is_autodiff_v<T_y> || is_autodiff_v<T_inv_scale>) {
161163 const T_partials_return log_y = log (y_dbl);
162164 const T_partials_return alpha_minus_one = fma (alpha_dbl, log_y, -log_y);
163165
164- const T_partials_return log_pdf
165- = alpha_dbl * log (beta_dbl) - lgamma (alpha_dbl) + alpha_minus_one - beta_y;
166+ const T_partials_return log_pdf = alpha_dbl * log (beta_dbl)
167+ - lgamma (alpha_dbl) + alpha_minus_one
168+ - beta_y;
166169
167170 const T_partials_return hazard = exp (log_pdf - log_Qn); // f/Q
168171
0 commit comments