Skip to content

Commit f8f8256

Browse files
stan-buildbotsyclik
authored andcommitted
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
1 parent 5053a4b commit f8f8256

3 files changed

Lines changed: 11 additions & 10 deletions

File tree

stan/math/prim/prob/gamma_lccdf.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ namespace math {
2727
namespace internal {
2828

2929
template <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

test/unit/math/prim/prob/gamma_lccdf_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ TEST(ProbGamma, lccdf_large_alpha_1000_beta_3) {
197197
<< "Failed for y=" << y << ", alpha=" << alpha << ", beta=" << beta;
198198

199199
// Result should be <= 0 (log of probability)
200-
EXPECT_LE(result, 0.0) << "Positive value for y=" << y << ", alpha="
201-
<< alpha << ", beta=" << beta;
200+
EXPECT_LE(result, 0.0) << "Positive value for y=" << y
201+
<< ", alpha=" << alpha << ", beta=" << beta;
202202
}
203203
}
204204

test/unit/math/rev/prob/gamma_lccdf_test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ TEST(ProbDistributionsGamma, lccdf_large_alpha_1000_beta_3) {
322322

323323
// Value should be finite and <= 0
324324
EXPECT_TRUE(std::isfinite(lccdf_var.val()))
325-
<< "Failed for y=" << y_d << ", alpha=" << alpha_d << ", beta="
326-
<< beta_d;
325+
<< "Failed for y=" << y_d << ", alpha=" << alpha_d
326+
<< ", beta=" << beta_d;
327327
EXPECT_LE(lccdf_var.val(), 0.0)
328328
<< "Positive value for y=" << y_d << ", alpha=" << alpha_d
329329
<< ", beta=" << beta_d;

0 commit comments

Comments
 (0)