Re: RFR: 4837946: Faster multiplication and exponentiation of large integers [v38]

2025-04-26 Thread fabioromano1
se, so the base is not squared like in > the current implementation, and this permits to save about half of the memory. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Throw away unsignedIntPow(int, int) - Changes: - all

Re: RFR: 4837946: Faster multiplication and exponentiation of large integers [v37]

2025-04-26 Thread fabioromano1
se, so the base is not squared like in > the current implementation, and this permits to save about half of the memory. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Use BigInteger(long, int) constructor -

Re: RFR: 4837946: Faster multiplication and exponentiation of large integers [v36]

2025-04-26 Thread fabioromano1
se, so the base is not squared like in > the current implementation, and this permits to save about half of the memory. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Optimized BigInteger.pow(int) to support unsigned long bases --

Re: RFR: 4837946: Faster multiplication and exponentiation of large integers [v35]

2025-04-26 Thread fabioromano1
On Sat, 26 Apr 2025 19:24:21 GMT, fabioromano1 wrote: > It seems your new `unsignedIntPow` already covers `base.mag.length == 1` case > - your `unsignedLongPow` and `unsignedIntPow` are otherwise identical. Can we > just remove this long shortcut and `unsignedLongPow` and use

Re: RFR: 4837946: Faster multiplication and exponentiation of large integers [v35]

2025-04-26 Thread fabioromano1
se, so the base is not squared like in > the current implementation, and this permits to save about half of the memory. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Put power's computation in a stand-alone method

Re: RFR: 4837946: Faster multiplication and exponentiation of large integers [v35]

2025-04-26 Thread fabioromano1
On Sat, 26 Apr 2025 19:16:14 GMT, Chen Liang wrote: > It seems your new `unsignedIntPow` already covers `base.mag.length == 1` case > - your `unsignedLongPow` and `unsignedIntPow` are otherwise identical. Can we > just remove this long shortcut and `unsignedLongPow` and use the newly > establi

Re: RFR: 4837946: Faster multiplication and exponentiation of large integers [v34]

2025-04-26 Thread fabioromano1
On Sat, 26 Apr 2025 17:22:09 GMT, Chen Liang wrote: >> src/java.base/share/classes/java/math/BigInteger.java line 2721: >> >>> 2719: if (!pow.equals(ONE)) { >>> 2720: for (int i = 0; i < blockLen; i++) >>> 2721: pow = pow.multiply(pow); >> >> Majo

Re: RFR: 4837946: Faster multiplication and exponentiation of large integers [v34]

2025-04-26 Thread fabioromano1
se, so the base is not squared like in > the current implementation, and this permits to save about half of the memory. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Removed method used by nth-root - Changes: - all

Re: RFR: 8077587: BigInteger Roots [v33]

2025-04-26 Thread fabioromano1
se, so the base is not squared like in > the current implementation, and this permits to save about half of the memory. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Moved nth-root implementation to a dependent PR -

RFR: 8077587: BigInteger Roots

2025-04-26 Thread fabioromano1
This PR implements nth root computation for BigIntegers using Newton method. This PR is dependent by this [PR](https://github.com/openjdk/jdk/pull/24690). - Commit messages: - Merge branch 'openjdk:master' into BigInteger-nth-root - Optimized nth root iteration loop - Systematizat

Re: RFR: 8077587: BigInteger Roots [v32]

2025-04-26 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. fabioromano1 has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in

Re: RFR: 8077587: BigInteger Roots [v19]

2025-04-24 Thread fabioromano1
On Thu, 24 Apr 2025 18:17:38 GMT, Raffaello Giulietti wrote: > * Performance enhancements in `pow()`, which is of general interest and does > not require submitting a [CSR](https://wiki.openjdk.org/display/csr/Main). @rgiulietti Yes, but here, the primary enhancement in `pow()` is not concerne

Re: RFR: 8077587: BigInteger Roots [v31]

2025-04-24 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v30]

2025-04-24 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v29]

2025-04-24 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v28]

2025-04-24 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v27]

2025-04-22 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v26]

2025-04-22 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v25]

2025-04-22 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v24]

2025-04-22 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v23]

2025-04-21 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v22]

2025-04-21 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v21]

2025-04-21 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v20]

2025-04-21 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v19]

2025-04-21 Thread fabioromano1
On Mon, 21 Apr 2025 10:14:05 GMT, Andrew Haley wrote: > That's very nice. It would be even nicer if this was a permalink into the JDK > repo, and a reference in the source code. @theRealAph Ok. It would be useful to have a link to an explanation on how this can be done, if there is one. Thanks

Re: RFR: 8077587: BigInteger Roots [v19]

2025-04-21 Thread fabioromano1
On Mon, 21 Apr 2025 10:05:21 GMT, Andrew Haley wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Code simplification > > src/java.base/share/classes/java/math/MutableBigInte

Re: RFR: 8077587: BigInteger Roots [v18]

2025-04-21 Thread fabioromano1
On Sun, 20 Apr 2025 05:12:19 GMT, Chen Liang wrote: >> fabioromano1 has updated the pull request with a new target base due to a >> merge or a rebase. The incremental webrev excludes the unrelated changes >> brought in by the merge/rebase. The pull request contains 21 addi

Re: RFR: 8077587: BigInteger Roots [v19]

2025-04-20 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v18]

2025-04-19 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v17]

2025-04-19 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v16]

2025-04-19 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v15]

2025-04-19 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v14]

2025-04-19 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v13]

2025-04-19 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v12]

2025-04-18 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v11]

2025-04-18 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v9]

2025-04-18 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v3]

2025-04-18 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v10]

2025-04-18 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v8]

2025-04-17 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v7]

2025-04-17 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v6]

2025-04-17 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v5]

2025-04-16 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v4]

2025-04-16 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

Re: RFR: 8077587: BigInteger Roots [v2]

2025-04-16 Thread fabioromano1
On Wed, 16 Apr 2025 22:05:34 GMT, fabioromano1 wrote: >> This PR implements nth root computation for `BigInteger`s using Newton >> method and optimizes `BigInteger.pow(int)` method. >> [Here is a proof of convergence of the recurrence >> used.](https://github.co

Re: RFR: 8077587: BigInteger Roots [v2]

2025-04-16 Thread fabioromano1
> This PR implements nth root computation for `BigInteger`s using Newton method > and optimizes `BigInteger.pow(int)` method. > [Here is a proof of convergence of the recurrence > used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) fabi

RFR: 8077587: BigInteger Roots

2025-04-16 Thread fabioromano1
This PR implements nth root computation for `BigInteger`s using Newton method and optimizes `BigInteger.pow(int)` method. - Commit messages: - Remove trailing whitespaces - Merge branch 'openjdk:master' into BigInteger-nth-root - Add nthRoot(int) methods and optimize pow(int) Cha

Integrated: 8341402: BigDecimal's square root optimization

2025-04-10 Thread fabioromano1
On Wed, 2 Oct 2024 10:31:09 GMT, fabioromano1 wrote: > After changing `BigInteger.sqrt()` algorithm, this can be also used to speed > up `BigDecimal.sqrt()` implementation. Here is how I made it. > > The main steps of the algorithm are as follows: > first argument reduce

Re: RFR: 8341402: BigDecimal's square root optimization [v31]

2025-04-04 Thread fabioromano1
On Wed, 4 Dec 2024 14:56:02 GMT, fabioromano1 wrote: >> After changing `BigInteger.sqrt()` algorithm, this can be also used to speed >> up `BigDecimal.sqrt()` implementation. Here is how I made it. >> >> The main steps of the algorithm are as follows: >> first a

Re: RFR: 8341402: BigDecimal's square root optimization [v32]

2025-03-28 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request c

Re: RFR: 8341402: BigDecimal's square root optimization [v31]

2025-02-10 Thread fabioromano1
On Mon, 10 Feb 2025 09:17:51 GMT, Per Minborg wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> An optimization > > This PR seems to be targeting performance, yet no benchmarks are pro

Re: RFR: 8341402: BigDecimal's square root optimization [v31]

2025-02-08 Thread fabioromano1
On Wed, 4 Dec 2024 14:56:02 GMT, fabioromano1 wrote: >> After changing `BigInteger.sqrt()` algorithm, this can be also used to speed >> up `BigDecimal.sqrt()` implementation. Here is how I made it. >> >> The main steps of the algorithm are as follows: >> first a

Re: RFR: 8341402: BigDecimal's square root optimization [v31]

2025-01-11 Thread fabioromano1
On Wed, 4 Dec 2024 14:56:02 GMT, fabioromano1 wrote: >> After changing `BigInteger.sqrt()` algorithm, this can be also used to speed >> up `BigDecimal.sqrt()` implementation. Here is how I made it. >> >> The main steps of the algorithm are as follows: >> first a

Re: RFR: 8341402: BigDecimal's square root optimization [v31]

2024-12-04 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: An optimization - Changes: - all: https://git.openjdk.org/jdk/pull/21301/fi

Re: RFR: 8341402: BigDecimal's square root optimization [v30]

2024-11-29 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Refine documentation - Changes: - all: https://git.openjdk.org/jdk/pull/213

Re: RFR: 8341402: BigDecimal's square root optimization [v29]

2024-11-29 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Speed up computation of bitLength() - Changes: - all: https://git.op

Re: RFR: 8341402: BigDecimal's square root optimization [v28]

2024-11-28 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: An optimization - Changes: - all: https://git.openjdk.org/jdk/pull/21301/fi

Re: RFR: 8341402: BigDecimal's square root optimization [v26]

2024-11-28 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Optimization for integer BigDecimals detection - Changes: - all: https:/

Re: RFR: 8341402: BigDecimal's square root optimization [v27]

2024-11-28 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Make digitLengthLower() static - Changes: - all: https://git.op

Re: RFR: 8341402: BigDecimal's square root optimization [v25]

2024-11-28 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Optimized integer BigDecimals detection - Changes: - all: https://git.op

Re: RFR: 8341402: BigDecimal's square root optimization [v24]

2024-11-26 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Added test for scale overflow - Changes: - all: https://git.op

Re: RFR: 8341402: BigDecimal's square root optimization [v23]

2024-11-26 Thread fabioromano1
On Tue, 26 Nov 2024 17:22:41 GMT, Raffaello Giulietti wrote: > I don't get your point. Here's an example: > > ``` > BigDecimal.ONE.sqrt(new MathContext(2_000_000_000, RoundingMode.UP)) > | Exception java.lang.ArithmeticException: Overflow > |at BigDecimal.sqrt (BigDecimal.java:2226) >

Re: RFR: 8341402: BigDecimal's square root optimization [v23]

2024-11-26 Thread fabioromano1
On Tue, 26 Nov 2024 17:04:49 GMT, fabioromano1 wrote: >> OK. >> But for the sake of completeness, I would add at least one test case for an >> overflowing `workingScale`. >> >> Other than that, the PR is then in good shape for approval. > >> OK. But for t

Re: RFR: 8341402: BigDecimal's square root optimization [v23]

2024-11-26 Thread fabioromano1
On Tue, 26 Nov 2024 15:02:20 GMT, Raffaello Giulietti wrote: > OK. But for the sake of completeness, I would add at least one test case for > an overflowing `workingScale`. I'm afraid it's not possible to produce such a test case, with the current implementation of `BigInteger`. Indeed, `work

Re: RFR: 8341402: BigDecimal's square root optimization [v23]

2024-11-26 Thread fabioromano1
On Tue, 26 Nov 2024 14:08:23 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Added tests for exact results path > > test/jdk/java/math/BigDecimal/SquareRoot

Re: RFR: 8341402: BigDecimal's square root optimization [v23]

2024-11-25 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Added tests for exact results path - Changes: - all: https://git.op

Re: RFR: 8341402: BigDecimal's square root optimization [v20]

2024-11-22 Thread fabioromano1
On Fri, 22 Nov 2024 14:21:50 GMT, Raffaello Giulietti wrote: > Not sure if you are planning to make other code changes before adding the > tests? From my perspective, the current status of the code looks good. No, I'm not planning to make other changes, I will add the tests soon.

Re: RFR: 8341402: BigDecimal's square root optimization [v17]

2024-11-20 Thread fabioromano1
On Tue, 19 Nov 2024 09:21:08 GMT, Raffaello Giulietti wrote: > While you are at it, it would be useful to add one test for each of the paths > in the new algorithm (including the exception cases) in the existing > [SquareRootTests](https://github.com/openjdk/jdk/blob/master/test/jdk/java/math/

Re: RFR: 8341402: BigDecimal's square root optimization [v22]

2024-11-20 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Code simplification - Changes: - all: https://git.openjdk.org/jdk/pull/213

Re: RFR: 8341402: BigDecimal's square root optimization [v21]

2024-11-20 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Code simplifications - Changes: - all: https://git.openjdk.org/jdk/pull/213

Re: RFR: 8341402: BigDecimal's square root optimization [v20]

2024-11-19 Thread fabioromano1
On Tue, 19 Nov 2024 18:43:46 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Correct remainder checking > > src/java.base/share/classes/java/math/BigDeci

Re: RFR: 8341402: BigDecimal's square root optimization [v20]

2024-11-19 Thread fabioromano1
On Tue, 19 Nov 2024 18:44:27 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Correct remainder checking > > src/java.base/share/classes/java/math/BigDeci

Re: RFR: 8341402: BigDecimal's square root optimization [v20]

2024-11-19 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Correct remainder checking - Changes: - all: https://git.op

Re: RFR: 8341402: BigDecimal's square root optimization [v19]

2024-11-19 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Optimization for non-zero remainder checking - Changes: - all: https:/

Re: RFR: 8341402: BigDecimal's square root optimization [v18]

2024-11-19 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request c

Re: RFR: 8341402: BigDecimal's square root optimization [v17]

2024-11-15 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Optimize sqrt branch for exact results - Changes: - all: https://git.op

Re: RFR: 8341402: BigDecimal's square root optimization [v16]

2024-11-15 Thread fabioromano1
On Fri, 15 Nov 2024 13:22:32 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Code simplification > > src/java.base/share/classes/java/math/BigDeci

Re: RFR: 8341402: BigDecimal's square root optimization

2024-11-13 Thread fabioromano1
t;> >> Because it is not necessary to strip zeros when an exact result is not >> requested, so while the call to `stripTrailingZeros()` speeds up only for >> the unlikely case that the input is an even power of 10, it slows down for >> all other cases... > > @

Re: RFR: 8341402: BigDecimal's square root optimization [v16]

2024-10-22 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Code simplification - Changes: - all: https://git.openjdk.org/jdk/pull/213

Re: RFR: 8341402: BigDecimal's square root optimization [v15]

2024-10-22 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Refine documentation - Changes: - all: https://git.openjdk.org/jdk/pull/213

Re: RFR: 8341402: BigDecimal's square root optimization [v14]

2024-10-22 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Refine documentation - Changes: - all: https://git.openjdk.org/jdk/pull/213

Re: RFR: 8341402: BigDecimal's square root optimization [v13]

2024-10-22 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Avoid overflow - Changes: - all: https://git.openjdk.org/jdk/pull/21301/fi

Re: RFR: 8341402: BigDecimal's square root optimization [v12]

2024-10-22 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: adjust to preferred scale in each branch for speed - Changes: - all: https:/

Re: RFR: 8341402: BigDecimal's square root optimization [v11]

2024-10-22 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Increment the unscaled sqrt for speed and round the result - Changes: - all:

Re: RFR: 8341402: BigDecimal's square root optimization [v10]

2024-10-21 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Ensure no increase of precision in 99...9+1 cases - Changes: - all: https:/

Re: RFR: 8341402: BigDecimal's square root optimization [v9]

2024-10-21 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Do round up with ulp in the final result Do round up with ulp in the final res

Re: RFR: 8341402: BigDecimal's square root optimization [v8]

2024-10-21 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with two additional commits since the last revision: - Removed unused variable - Ensure the result does not exceed the requested precision

Re: RFR: 8341402: BigDecimal's square root optimization

2024-10-21 Thread fabioromano1
On Mon, 21 Oct 2024 16:47:36 GMT, Raffaello Giulietti wrote: > Since there's an invocation of `stripTrailingZeros()` anyway, what's the > reason to _not_ "optimize" for other round modes as well, like in the current > implementation? Because it is not necessary to strip zeros when an exact re

Re: RFR: 8341402: BigDecimal's square root optimization [v2]

2024-10-21 Thread fabioromano1
On Thu, 3 Oct 2024 00:47:23 GMT, Joe Darcy wrote: > My initial question is what additional regression test cases should be added > to probe the new code. @rgiulietti @jddarcy This should be the path tree for the test cases of the algorithm, whether `signum == 1`: If `mc.roundingMode == Roundi

Re: RFR: 8341402: BigDecimal's square root optimization [v7]

2024-10-21 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Removed trailing whitespaces - Changes: - all: https://git.op

Re: RFR: 8341402: BigDecimal's square root optimization [v6]

2024-10-21 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Compute sqrt remainder only if needed to round - Changes: - all: https:/

Re: RFR: 8341402: BigDecimal's square root optimization [v5]

2024-10-21 Thread fabioromano1
exponent range and perform any adjustment > to get the preferred scale in the representation. fabioromano1 has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request co

Integrated: 8341470: BigDecimal.stripTrailingZeros() optimization

2024-10-21 Thread fabioromano1
On Thu, 3 Oct 2024 12:29:44 GMT, fabioromano1 wrote: > An optimized algorithm for `BigDecimal.stripTrailingZeros()` that uses > repeated squares trick. This pull request has now been integrated. Changeset: 27ef6c9d Author:fabioromano1 <51378941+fabioroma...@users.noreply.g

Re: RFR: 8341470: BigDecimal.stripTrailingZeros() optimization [v48]

2024-10-18 Thread fabioromano1
> An optimized algorithm for `BigDecimal.stripTrailingZeros()` that uses > repeated squares trick. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Refine comments to point out the substructure of the method's cont

Re: RFR: 8341470: BigDecimal.stripTrailingZeros() optimization [v44]

2024-10-17 Thread fabioromano1
On Thu, 17 Oct 2024 15:19:52 GMT, fabioromano1 wrote: >> Will approve at the beginning of next week to let you add some last minute >> (not substantial) changes during the next few days. > >> In any reduction approach, you still need to prove that the reduced problem &g

Re: RFR: 8341470: BigDecimal.stripTrailingZeros() optimization [v44]

2024-10-17 Thread fabioromano1
On Thu, 17 Oct 2024 15:17:38 GMT, Raffaello Giulietti wrote: >> With the definition remainingZeros = scale - preferredScale, the proof above >> could be adapted almost on the fly to the old implementation. >> >> In any reduction approach, you still need to prove that the reduced problem >> is

Re: RFR: 8341470: BigDecimal.stripTrailingZeros() optimization [v44]

2024-10-17 Thread fabioromano1
On Thu, 17 Oct 2024 14:29:36 GMT, Raffaello Giulietti wrote: >>> The comments are OK. However, there seems to be no explicit relation >>> between the "running" vars used in the reasoning and the expected outcome. >>> >>> To clarify what I mean, let v0, z0 and s0 be the initial values at method

Re: RFR: 8341470: BigDecimal.stripTrailingZeros() optimization [v44]

2024-10-17 Thread fabioromano1
On Thu, 17 Oct 2024 12:38:29 GMT, Raffaello Giulietti wrote: > The comments are OK. However, there seems to be no explicit relation between > the "running" vars used in the reasoning and the expected outcome. > > To clarify what I mean, let v0, z0 and s0 be the initial values at method > entr

Re: RFR: 8341470: BigDecimal.stripTrailingZeros() optimization [v47]

2024-10-15 Thread fabioromano1
> An optimized algorithm for `BigDecimal.stripTrailingZeros()` that uses > repeated squares trick. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Refining the loop invariant for more clear proof - Changes:

Re: RFR: 8341470: BigDecimal.stripTrailingZeros() optimization [v44]

2024-10-15 Thread fabioromano1
On Tue, 15 Oct 2024 09:18:59 GMT, fabioromano1 wrote: >> Anyway, if you find a nice proof please add it to the comments. The >> algorithm is quite sophisticated, so it needs one. > > I would say yes... The invariant `i == max{n : 5^(2^n) <= 5^remainingZeros}` > should b

  1   2   3   4   >