statrs-dev / statrs

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

Fix: Exponential distribution inverse CDF accuracy & performance #190

Closed tessob closed 4 months ago

tessob commented 1 year ago

Hello,

While working on my project, I found that this function is calculated with a rather large margin of error. So, I had replaced the generic implementation with the specific one. If you comment out my implementation of the trait method, you will see what I am talking about from the test errors.

Also have find a bit weird behaviour of cargo test command when it simply ignores my tests, and probably some other tests too.

BR, .

Magnetuz commented 7 months ago

Hi @tessob.

I cloned your branch and ran the tests with cargo +nightly test --features nightly --lib.

I can see your test test_inverse_cdf running and passing. So it is fine.

Best regards.

tessob commented 7 months ago

Hi @Magnetuz,

Thank you. I tested my code before commit. It just took some time to comprehend what was necessary to do. I think that a CONTRIBUTION.md file is needed in this repository.

YeungOnion commented 6 months ago

Thanks for the PR, we'd like to implement inverse_cdf over search where possible.