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

2024-07-18 Thread Raffaello Giulietti
On Thu, 18 Jul 2024 15:22:39 GMT, Raffaello Giulietti wrote: >> I found the way: I can test directly the code through >> `java.math.Accessor.java` > > I think there's a misunderstanding here. > > What I'd like to see is a test that verifies the claim > > /* For every long value s in [

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

2024-07-18 Thread Raffaello Giulietti
On Thu, 18 Jul 2024 15:09:41 GMT, fabioromano1 wrote: >>> I mean only restricted to unsigned `long` perfect squares, something like >>> the following, but written as a proper test >>> >>> ``` >>> long i = 0; >>> for (; i < 1L << 32; ++i) { >>> long x = i * i; >>>

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

2024-07-18 Thread fabioromano1
On Thu, 18 Jul 2024 15:01:22 GMT, fabioromano1 wrote: >> It takes about 5 s on my laptop. > >> I mean only restricted to unsigned `long` perfect squares, something like >> the following, but written as a proper test >> >> ``` >> long i = 0; >> for (; i < 1L << 32; ++i) { >>

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

2024-07-18 Thread Raffaello Giulietti
On Thu, 18 Jul 2024 14:55:30 GMT, fabioromano1 wrote: >> src/java.base/share/classes/java/math/MutableBigInteger.java line 2135: >> >>> 2133: * @param limit the offset which is the end of valid words in the >>> input value >>> 2134: * @param blockLen the length of the block in units o

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

2024-07-18 Thread fabioromano1
On Thu, 18 Jul 2024 14:50:00 GMT, Raffaello Giulietti wrote: >> I mean only restricted to unsigned `long` perfect squares, something like >> the following, but written as a proper test >> >> >> long i = 0; >> for (; i < 1L << 32; ++i) { >> long x = i * i; >>

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

2024-07-18 Thread fabioromano1
On Thu, 18 Jul 2024 13:40:38 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> More accurate comment > > src/java.base/share/classes/java/math/MutableBigInteger.java line 2135: > >> 2133:

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

2024-07-18 Thread Raffaello Giulietti
On Thu, 18 Jul 2024 14:39:16 GMT, fabioromano1 wrote: >> src/java.base/share/classes/java/math/MutableBigInteger.java line 1973: >> >>> 1971: >>> 1972: /* For every long value s in [0, 2^32) such that x == s * >>> s, >>> 1973: * it is true that s == Math.round(Math.sqr

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

2024-07-18 Thread Raffaello Giulietti
On Thu, 18 Jul 2024 14:49:19 GMT, Raffaello Giulietti wrote: >> I did it, although I'm afraid it takes up too much running time due to the >> overhead of BigInteger's wrapping... > > I mean only restricted to unsigned `long` perfect squares, something like the > following, but written as a pro

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

2024-07-18 Thread fabioromano1
On Thu, 18 Jul 2024 13:39:01 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> More accurate comment > > src/java.base/share/classes/java/math/MutableBigInteger.java line 1973: > >> 1971:

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

2024-07-18 Thread Raffaello Giulietti
On Wed, 17 Jul 2024 15:33:39 GMT, fabioromano1 wrote: >> I have implemented the Zimmermann's square root algorithm, available in >> works [here](https://inria.hal.science/inria-00072854/en/) and >> [here](https://www.researchgate.net/publication/220532560_A_proof_of_GMP_square_root). >> >> The

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

2024-07-17 Thread fabioromano1
> I have implemented the Zimmermann's square root algorithm, available in works > [here](https://inria.hal.science/inria-00072854/en/) and > [here](https://www.researchgate.net/publication/220532560_A_proof_of_GMP_square_root). > > The algorithm is proved to be asymptotically faster than the New