Skip to content

Commit 352ef47

Browse files
committed
breakdown large compile time conditional statement into smaller lines
1 parent 8e29962 commit 352ef47

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

stan/math/prim/prob/gamma_lccdf.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,10 @@ inline return_type_t<T_y, T_shape, T_inv_scale> gamma_lccdf(
128128
scalar_seq_view<T_beta_ref> beta_vec(beta_ref);
129129
const size_t N = max_size(y, alpha, beta);
130130

131-
constexpr bool any_fvar
132-
= is_fvar_v<scalar_type_t<
133-
T_y>> || is_fvar_v<scalar_type_t<T_shape>> || is_fvar_v<scalar_type_t<T_inv_scale>>;
131+
constexpr bool is_y_fvar = is_fvar_v<scalar_type_t<T_y>>;
132+
constexpr bool is_shape_fvar = is_fvar_v<scalar_type_t<T_shape>>;
133+
constexpr bool is_beta_fvar = is_fvar_v<scalar_type_t<T_inv_scale>>;
134+
constexpr bool any_fvar = is_y_fvar || is_shape_fvar || is_beta_fvar;
134135
constexpr bool partials_fvar = is_fvar_v<T_partials_return>;
135136

136137
for (size_t n = 0; n < N; n++) {

0 commit comments

Comments
 (0)