On Wed, 17 Jul 2024 16:39:10 GMT, fabioromano1 wrote:
>> Can try with the old release and the incorrect code again?
>> If the results disagree with newer releases then I'd be interested in which
>> release you were using, as to analyze the generated code and possibly file a
>> bug report for th
On Wed, 17 Jul 2024 16:16:12 GMT, Raffaello Giulietti
wrote:
>> Can try with the old release and the incorrect code again?
>> If the results disagree with newer releases then I'd be interested in which
>> release you were using, as to analyze the generated code and possibly file a
>> bug repor
On Wed, 17 Jul 2024 16:16:12 GMT, Raffaello Giulietti
wrote:
>> Can try with the old release and the incorrect code again?
>> If the results disagree with newer releases then I'd be interested in which
>> release you were using, as to analyze the generated code and possibly file a
>> bug repor
On Wed, 17 Jul 2024 15:59:30 GMT, fabioromano1 wrote:
>> Sorry, disregard the above as it doesn't work for x = 0.
>
> @rgiulietti Probably I used a too older release to try the incorrect code
Can try with the old release and the incorrect code again?
If the results disagree with newer releases t
On Wed, 17 Jul 2024 16:15:47 GMT, Raffaello Giulietti
wrote:
>> @rgiulietti Probably I used a too older release to try the incorrect code
>
> Can try with the old release and the incorrect code again?
> If the results disagree with newer releases then I'd be interested in which
> release you we
On Wed, 17 Jul 2024 15:11:36 GMT, Raffaello Giulietti
wrote:
>> Also, this avoids a test
>>
>> if (Long.compareUnsigned(x, s * s - 1) <= 0) { // benign over-
>> and underflows
>> s--;
>> }
>
> Sorry, disregard the above as it doesn't work for x = 0.
@r
On Wed, 17 Jul 2024 15:11:36 GMT, Raffaello Giulietti
wrote:
>> Also, this avoids a test
>>
>> if (Long.compareUnsigned(x, s * s - 1) <= 0) { // benign over-
>> and underflows
>> s--;
>> }
>
> Sorry, disregard the above as it doesn't work for x = 0.
>
On Wed, 17 Jul 2024 15:08:22 GMT, Raffaello Giulietti
wrote:
>> @rgiulietti This is so strange... anyway, I tried also `long x = n * n`,
>> `long s = Math.round(Math.sqrt(x >= 0 ? x : x + 0x1p64))` with the test `s <
>> n`, which I think it's more mathematically natural, and also this never
On Wed, 17 Jul 2024 14:30:33 GMT, fabioromano1 wrote:
>> I tried on older release, they all agree.
>
> @rgiulietti This is so strange... anyway, I tried also `long x = n * n`,
> `long s = Math.round(Math.sqrt(x >= 0 ? x : x + 0x1p64))` with the test `s <
> n`, which I think it's more mathemati
On Wed, 17 Jul 2024 14:11:20 GMT, fabioromano1 wrote:
>> There are no counterexamples for perfect squares if you write `long s =
>> (long) Math.rint(Math.sqrt(x >= 0 ? x : x + 0x1p64));`.
>
> @rgiulietti Is it normal that the same code did not find counterexamples
> until recently, and now it f
On Wed, 17 Jul 2024 14:17:48 GMT, Raffaello Giulietti
wrote:
>> @rgiulietti Is it normal that the same code did not find counterexamples
>> until recently, and now it finds them?
>
> I tried on older release, they all agree.
@rgiulietti This is so strange... anyway, I tried also `long x = n *
On Wed, 17 Jul 2024 13:57:20 GMT, Raffaello Giulietti
wrote:
>> I hope these errors are not due to an implementation change in the virtual
>> machine instructions...
>
> There are no counterexamples for perfect squares if you write `long s =
> (long) Math.rint(Math.sqrt(x >= 0 ? x : x + 0x1p64
On Wed, 17 Jul 2024 13:57:06 GMT, fabioromano1 wrote:
>> In fact, if you run this code:
>> `long limit = 1L << 32;
>> for (long n = 0; n < limit; n++) {
>> long x = n * n;
>> if (n != (long) Math.sqrt(x >= 0 ? x : x + 0x1p64)) {
>> System.out.println(n);
>> }
>> }`
>>
On Wed, 17 Jul 2024 13:48:59 GMT, fabioromano1 wrote:
>> src/java.base/share/classes/java/math/MutableBigInteger.java line 1978:
>>
>>> 1976: * is either correct, or rounded up by one if the value
>>> is too high
>>> 1977: * and too close to the next perfect square.
>>
On Wed, 17 Jul 2024 13:15:17 GMT, Raffaello Giulietti
wrote:
>> fabioromano1 has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Optimized shift-and-add operations
>
> src/java.base/share/classes/java/math/MutableBigInteger.java line 1978:
On Mon, 15 Jul 2024 19:58:23 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
On Mon, 15 Jul 2024 19:58:23 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
> 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
18 matches
Mail list logo