Skip to content

Commit

Permalink
refactor: alternative exp function call
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn committed Dec 26, 2024
1 parent d5c85ed commit bcbb388
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/osu/difficulty/skills/speed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl Speed {
.object_strains
.iter()
.fold(0.0, |sum, strain| {
sum + (1.0 + (-(strain / max_strain * 12.0 - 6.0)).exp()).recip()
sum + (1.0 + f64::exp(-(strain / max_strain * 12.0 - 6.0))).recip()
})
})
}
Expand Down
2 changes: 1 addition & 1 deletion src/taiko/difficulty/skills/stamina.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl Skill<'_, Stamina> {
.unwrap_or(0);

if self.inner.single_color {
self.curr_strain() / (1.0 + ((-(index as isize - 10)) as f64 / 2.0).exp())
self.curr_strain() / (1.0 + f64::exp((-(index as isize - 10)) as f64 / 2.0))
} else {
self.curr_strain()
}
Expand Down
2 changes: 1 addition & 1 deletion src/util/special_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ fn erf_imp(z: f64, mut invert: bool) -> f64 {
)
};

let g = (-z * z).exp() / z;
let g = f64::exp(-z * z) / z;

(g * b) + (g * r)
} else {
Expand Down

0 comments on commit bcbb388

Please sign in to comment.