@@ -27,12 +27,12 @@ namespace math {
2727namespace internal {
2828
2929template <typename T_a>
30- inline auto log_q_gamma_cf (const T_a& a, const double x,
31- int max_steps = 250 , double precision = 1e-16 ) {
32- using std::fabs;
30+ inline auto log_q_gamma_cf (const T_a& a, const double x, int max_steps = 250 ,
31+ double precision = 1e-16 ) {
3332 using stan::math::lgamma;
3433 using stan::math::log;
3534 using stan::math::value_of;
35+ using std::fabs;
3636
3737 const auto log_prefactor = a * log (x) - x - lgamma (a);
3838
@@ -131,7 +131,8 @@ return_type_t<T_y, T_shape, T_inv_scale> gamma_lccdf(const T_y& y,
131131 bool use_cf = beta_y > alpha_dbl + 1.0 ;
132132 T_partials_return log_Qn;
133133 [[maybe_unused]] T_partials_return dlogQ_dalpha = 0.0 ;
134- // Extract double values for continued fraction - we handle y/beta derivatives via hazard
134+ // Extract double values for continued fraction - we handle y/beta
135+ // derivatives via hazard
135136 const double beta_y_dbl = value_of (value_of (beta_y));
136137 const double alpha_dbl_val = value_of (value_of (alpha_dbl));
137138
@@ -191,8 +192,8 @@ return_type_t<T_y, T_shape, T_inv_scale> gamma_lccdf(const T_y& y,
191192 const T_partials_return lgamma_alpha = lgamma (alpha_dbl);
192193 const T_partials_return alpha_minus_one = fma (alpha_dbl, log_y, -log_y);
193194
194- const T_partials_return log_pdf = alpha_dbl * log_beta - lgamma_alpha
195- + alpha_minus_one - beta_y;
195+ const T_partials_return log_pdf
196+ = alpha_dbl * log_beta - lgamma_alpha + alpha_minus_one - beta_y;
196197
197198 const T_partials_return hazard = exp (log_pdf - log_Qn); // f/Q
198199
0 commit comments