statrs-dev / statrs

Statistical computation library for Rust
https://docs.rs/statrs/latest/statrs/
MIT License
582 stars 83 forks source link

Adds an `inverse_cdf()` specialization for Uniform #166

Closed TonyRippy closed 5 months ago

TonyRippy commented 2 years ago

Without this, it falls back to the default binary search algorithm, which is not as accurate. For example: using the binary search Uniform::new(0.0, 10.0).unwrap().inverse_cdf(0.5) yeilds 5.0000457763671875, whereas the new specialization yeilds 5.0.

TonyRippy commented 11 months ago

Hello, is anyone available to review this PR? I am still interested in getting this change merged.

YeungOnion commented 5 months ago

Merged as 9e63ee4, thanks for this!