const float c12 = ljcp_i.y * ljcp_j.y;
# else
/* LJ 2^(1/6)*sigma and 12*epsilon */
- const float sigma = ljcp_i.x + ljcp_j.x;
- const float epsilon = ljcp_i.y * ljcp_j.y;
+ const float sigma = ljcp_i.x + ljcp_j.x;
+ const float epsilon = ljcp_i.y * ljcp_j.y;
# if defined CALC_ENERGIES || defined LJ_FORCE_SWITCH || defined LJ_POT_SWITCH
- float c6, c12;
- convert_sigma_epsilon_to_c6_c12(sigma, epsilon, &c6, &c12);
+ const float2 c6c12 = convert_sigma_epsilon_to_c6_c12(sigma, epsilon);
+ const float c6 = c6c12.x;
+ const float c12 = c6c12.y;
# endif
# endif /* LJ_COMB_GEOM */
#endif /* LJ_COMB */
// Ensure distance do not become so small that r^-12 overflows.
- // Cast to float to ensure the correct built-in max() function
- // is called.
- r2 = max(r2, (float)c_nbnxnMinDistanceSquared);
+ r2 = max(r2, c_nbnxnMinDistanceSquared);
const float inv_r = rsqrt(r2);
const float inv_r2 = inv_r * inv_r;