RFR: 8326227: Fix a rare rounding error affecting RandomSupport::computeNextGaussian

Chris Hennick duke at openjdk.org
Tue Feb 20 20:11:07 UTC 2024


On Mon, 5 Feb 2024 04:25:16 GMT, Chris Hennick <duke at openjdk.org> wrote:

> This provides a slightly more accurate bounding limit for `computeNextExponentialSoftCapped` when the computed bound is greater than `(1.0p53 - 1.0) * DoubleZigguratTables.exponentialX0`. This could cause the `while (computeNextExponentialSoftCapped(rng, limit) < limit)` check in `computeNextGaussian` on line 1402 to always be true, making the `nextGaussian` runtime unbounded in the worst case.

I've submitted a bug report for this issue at https://bugs.java.com/bugdatabase/view_bug.do?bug_id=9076599; it hasn't been published yet.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17703#issuecomment-1953438988


More information about the core-libs-dev mailing list