Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix inverse_discrete_quantile for large guess #1007

Merged
merged 1 commit into from
Aug 24, 2023

Commits on Aug 5, 2023

  1. Fix inverse_discrete_quantile for large guess

    If `guess` passed to `inverse_discrete_quantile` cannot be represented
    as floating point number, it is possible that `guess + 1` or `guess - 1`
    does not change the value at all and we are stuck in infinite loop
    inside `round_to_floor` or `round_to_ceil`.  Fix this by
    increase/decrease more than 1 in these cases.
    
    Example code to reproduce this:
    ```c++
    boost::math::binomial_distribution<> dist(9079765771874083840, 0.561815);
    boost::math::quantile(dist, 0.0365346);
    ```
    Yuhta committed Aug 5, 2023
    Configuration menu
    Copy the full SHA
    ee80892 View commit details
    Browse the repository at this point in the history