Skip to content

Commit

Permalink
fix: Prevent sqrt of negative values
Browse files Browse the repository at this point in the history
  • Loading branch information
joaoabcoelho committed Nov 9, 2023
1 parent 95babb7 commit 1a1f7af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/PMNS_SNSI.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void PMNS_SNSI::BuildHms()
fHms[0][0] = 0;
for (int j = 1; j < fNumNus; j++) {
// Set mass difference m_j - m_1
fHms[j][j] = sqrt(fDm[j] + m1 * m1) - m1;
fHms[j][j] = sqrt(fabs(fDm[j] + m1 * m1)) - m1;
// Reset off-diagonal elements
for (int i = 0; i < j; i++) { fHms[i][j] = 0; }
// Rotate j neutrinos
Expand Down

0 comments on commit 1a1f7af

Please sign in to comment.