RFR: 8334755: Asymptotically faster implementation of square root algorithm [v32]

fabioromano1 duke at openjdk.org
Thu Jul 18 15:58:36 UTC 2024


On Thu, 18 Jul 2024 15:27:53 GMT, Raffaello Giulietti <rgiulietti at openjdk.org> wrote:

> Experimentally, the following seems a bit faster. In some cases, it avoids a full multiplication, some updates, and has one less test. I hope it is correct as well ;-)

It's a nice code, but I'm afraid that if `s == LONG_MASK` and `Long.compareUnsigned(x, s * s) >= 0`, the overflow check is unavoidable...

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19710#discussion_r1683093419


More information about the core-libs-dev mailing list