Skip to content

Commit

Permalink
Cancel more exp(log()) occurrences.
Browse files Browse the repository at this point in the history
  • Loading branch information
RyanWollaeger committed Jan 22, 2025
1 parent 8ed3161 commit 33d68b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/jaybenne/sourcing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ TaskStatus SourcePhotons(T *md, const Real t_start, const Real dt) {
}
emis = 0.;
for (int n = 0; n < n_nubinsd; n++) {
const Real dnu = dlnu * std::exp(std::log(numind) + (n + 0.5) * dlnu);
const Real dnu = dlnu * numind * std::exp((n + 0.5) * dlnu);
// Get total emissivity
emis += vmesh(b, fj::emission_cdf(n), k, j, i);
// Normalize emission CDF
Expand Down Expand Up @@ -254,7 +254,7 @@ TaskStatus SourcePhotons(T *md, const Real t_start, const Real dt) {
}
}
const Real dlnu = (std::log(numaxd) - std::log(numind)) / n_nubinsd;
const Real nu = std::exp(std::log(numind) + (n + 0.5) * dlnu);
const Real nu = numind * std::exp((n + 0.5) * dlnu);
ppack_r(b, ph::energy(), n) = hd * nu;
}
ppack_r(b, ph::weight(), n) =
Expand Down

0 comments on commit 33d68b9

Please sign in to comment.