Skip to content

Commit

Permalink
fix: Use exp_m1 instead of subtracting directly
Browse files Browse the repository at this point in the history
- Added fix to use exp_m1 function to compute
sf for Gumbel distribution more accurately
  • Loading branch information
soumyasen1809 committed Sep 17, 2024
1 parent a395dd1 commit d267912
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/distribution/gumbel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ impl ContinuousCDF<f64, f64> for Gumbel {
///
/// where `μ` is the location and `β` is the scale
fn sf(&self, x: f64) -> f64 {
1.0 - (-(-(x - self.location) / self.scale).exp()).exp()
-(-(-(x - self.location) / self.scale).exp()).exp_m1()
}
}

Expand Down

0 comments on commit d267912

Please sign in to comment.