Skip to content

Commit 9e5ca4b

Browse files
committed
[Jenkins] auto-formatting by clang-format version 10.0.0-4ubuntu1
1 parent 1f112d3 commit 9e5ca4b

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

stan/math/prim/fun/log_gamma_q_dgamma.hpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ struct log_gamma_q_result {
4848
*/
4949
template <typename T_a, typename T_z>
5050
inline log_gamma_q_result<return_type_t<T_a, T_z>> log_gamma_q_dgamma(
51-
const T_a& a, const T_z& z, int max_steps = 250,
52-
double precision = 1e-16) {
51+
const T_a& a, const T_z& z, int max_steps = 250, double precision = 1e-16) {
5352
using std::exp;
5453
using std::fabs;
5554
using std::log;
@@ -99,7 +98,8 @@ inline log_gamma_q_result<return_type_t<T_a, T_z>> log_gamma_q_dgamma(
9998
// For gradient, use: d/da log(Q) = (1/Q) * dQ/da
10099
// grad_reg_inc_gamma computes dQ/da
101100
const double Q_val = exp(result.log_q);
102-
const double dQ_da = grad_reg_inc_gamma(a_dbl, z_dbl, tgamma(a_dbl), digamma(a_dbl));
101+
const double dQ_da
102+
= grad_reg_inc_gamma(a_dbl, z_dbl, tgamma(a_dbl), digamma(a_dbl));
103103
result.dlog_q_da = dQ_da / Q_val;
104104

105105
} else {
@@ -111,7 +111,8 @@ inline log_gamma_q_result<return_type_t<T_a, T_z>> log_gamma_q_dgamma(
111111
// grad_reg_inc_gamma computes dQ/da
112112
const double Q_val = exp(result.log_q);
113113
if (Q_val > 0) {
114-
const double dQ_da = grad_reg_inc_gamma(a_dbl, z_dbl, tgamma(a_dbl), digamma(a_dbl));
114+
const double dQ_da
115+
= grad_reg_inc_gamma(a_dbl, z_dbl, tgamma(a_dbl), digamma(a_dbl));
115116
result.dlog_q_da = dQ_da / Q_val;
116117
} else {
117118
// Fallback if Q rounds to zero - use asymptotic approximation

stan/math/prim/prob/gamma_lccdf.hpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ namespace internal {
3030

3131
/**
3232
* Compute log(Q(a,x)) using continued fraction expansion for upper incomplete
33-
* gamma function. When used with fvar types, automatically computes derivatives.
33+
* gamma function. When used with fvar types, automatically computes
34+
* derivatives.
3435
*
3536
* @tparam T_a Type of shape parameter a (double or fvar types)
3637
* @param a Shape parameter
@@ -118,10 +119,9 @@ return_type_t<T_y, T_shape, T_inv_scale> gamma_lccdf(const T_y& y,
118119
const size_t N = max_size(y, alpha, beta);
119120

120121
constexpr bool need_y_beta_deriv = !is_constant_all<T_y, T_inv_scale>::value;
121-
constexpr bool any_fvar
122-
= is_fvar<scalar_type_t<T_y>>::value
123-
|| is_fvar<scalar_type_t<T_shape>>::value
124-
|| is_fvar<scalar_type_t<T_inv_scale>>::value;
122+
constexpr bool any_fvar = is_fvar<scalar_type_t<T_y>>::value
123+
|| is_fvar<scalar_type_t<T_shape>>::value
124+
|| is_fvar<scalar_type_t<T_inv_scale>>::value;
125125
constexpr bool partials_fvar = is_fvar<T_partials_return>::value;
126126

127127
for (size_t n = 0; n < N; n++) {
@@ -164,8 +164,7 @@ return_type_t<T_y, T_shape, T_inv_scale> gamma_lccdf(const T_y& y,
164164
alpha_unit.d_ = 1;
165165
auto beta_unit = beta_y;
166166
beta_unit.d_ = 0;
167-
auto log_Qn_fvar
168-
= internal::log_q_gamma_cf(alpha_unit, beta_unit);
167+
auto log_Qn_fvar = internal::log_q_gamma_cf(alpha_unit, beta_unit);
169168
dlogQ_dalpha = log_Qn_fvar.d_;
170169
} else {
171170
const T_partials_return Qn = exp(log_Qn);

0 commit comments

Comments
 (0)