Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-23 Thread Raffaello Giulietti
On Wed, 23 Jul 2025 21:11:16 GMT, fabioromano1 wrote: >> I noticed the usage of exp() and log(), thanks for the change. >> >> My concerns about using transcendental are rooted in [this >> paper](https://members.loria.fr/PZimmermann/papers/accuracy.pdf). >> The Javadoc claims an error of 1 ulp f

Re: RFR: 8077587: BigInteger Roots [v39]

2025-07-23 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 84 commits: - Merge branch 'openjdk:master' into nth-root-branch - Revision changes - More

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-23 Thread fabioromano1
On Wed, 23 Jul 2025 19:49:51 GMT, Raffaello Giulietti wrote: >> @rgiulietti I've changed the formula that computes the initial estimate, now >> it does not use `Math.pow()` anymore, but `Math.exp()` and `Math.log()` >> instead, which are guaranteed to have always an error less than 1 ulp by

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-23 Thread Raffaello Giulietti
On Wed, 23 Jul 2025 17:40:22 GMT, fabioromano1 wrote: >> Can you please provide a succinct "proof" in form of a comment? Needs to be >> convincing, although not necessarily rigorous. > > @rgiulietti I've changed the formula that computes the initial estimate, now > it does not use `Math.pow()`

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-23 Thread fabioromano1
On Wed, 23 Jul 2025 17:05:07 GMT, Raffaello Giulietti wrote: >> @rgiulietti Now that I checked the recurrence better, it seems to me that it >> should give an overestimate if `rLong` is an underestimate, without modify >> it. > > Can you please provide a succinct "proof" in form of a comment?

Re: RFR: 8077587: BigInteger Roots [v38]

2025-07-23 Thread Raffaello Giulietti
On Wed, 23 Jul 2025 16:11:20 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > More accurate lower bound for doubles val

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-23 Thread Raffaello Giulietti
On Mon, 14 Jul 2025 16:41:15 GMT, fabioromano1 wrote: >> This is my hunch as well. >> So while the use of `nextUp()` and `ceil()` certainly help to achieve an >> overestimate, I'm less sure that this is sufficient when using `pow()`. If >> the latter has some error bigger than a few ulps, then

Re: RFR: 8077587: BigInteger Roots [v38]

2025-07-23 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: More accurate lower bound for doubles values tests - Changes: - all: https://git.openjdk.or

Re: RFR: 8077587: BigInteger Roots [v37]

2025-07-23 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: No need to ceiling the initial estimate if not shifted - Changes: - all: https://git.openjd

Re: RFR: 8077587: BigInteger Roots [v36]

2025-07-23 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Ensure an initial overestimate of the root Ensure an initial overestimate of the root, using Math.exp(

Re: RFR: 8077587: BigInteger Roots [v35]

2025-07-22 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with two additional commits since the last revision: - Merge branch 'nth-root-branch' of https://github.com/fabioromano1/jdk into nth-root-branch - Refinement

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-22 Thread Raffaello Giulietti
On Tue, 22 Jul 2025 18:38:28 GMT, fabioromano1 wrote: > The cases in which the method throws correspond to the cases in which the > integer root is not defined. Yes, that's why it should be part of the definition: like in "the largest integer ..., if it exists; otherwise the result is undefine

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-22 Thread fabioromano1
On Tue, 22 Jul 2025 15:26:25 GMT, Raffaello Giulietti wrote: >> I think this is probably what you are searching for. >> >> If x ≥ 0 there's at most one integer y ≥ 0 meeting y^n ≤ x < (y+1)^n. >> If x < 0 there's at most one integer y ≤ 0 meeting y^n ≥ x > (y-1)^n. >> The method returns y if it

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-22 Thread Raffaello Giulietti
On Wed, 16 Jul 2025 14:40:53 GMT, Raffaello Giulietti wrote: >> I don't know other ways to define it that don't involve the clause `!(x < 0 >> && n % 2 == 0)`. If the first definition is confusing, the only solution I >> see is to remove it, and leave only the formula `(x.signum() * >> floor(

Re: RFR: 8077587: BigInteger Roots [v34]

2025-07-22 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Added bug id - Changes: - all: https://git.openjdk.org/jdk/pull/24898/files - new: https:

Re: RFR: 8077587: BigInteger Roots [v33]

2025-07-22 Thread Mikhail Yankelevich
On Tue, 22 Jul 2025 11:21:46 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > No need to check for root's shift overflo

Re: RFR: 8077587: BigInteger Roots [v33]

2025-07-22 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: No need to check for root's shift overflow - Changes: - all: https://git.openjdk.org/jdk/pu

Re: RFR: 8077587: BigInteger Roots [v32]

2025-07-22 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Include one more possible correct bit in initial estimate - Changes: - all: https://git.ope

Re: RFR: 8077587: BigInteger Roots [v31]

2025-07-21 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Added tests for nth root - Changes: - all: https://git.openjdk.org/jdk/pull/24898/files -

Re: RFR: 8077587: BigInteger Roots [v30]

2025-07-21 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Revert "Make sure to round up" This reverts commit e305c9f68914553421f2fdd8b4389eaf03946fea.

Re: RFR: 8077587: BigInteger Roots [v29]

2025-07-21 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Make sure to round up - Changes: - all: https://git.openjdk.org/jdk/pull/24898/files - ne

Re: RFR: 8077587: BigInteger Roots [v28]

2025-07-21 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Discard wrong bits from the initial estimate - Changes: - all: https://git.openjdk.org/jdk/

Re: RFR: 8077587: BigInteger Roots [v27]

2025-07-20 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Formatting changes - Changes: - all: https://git.openjdk.org/jdk/pull/24898/files - new:

Re: RFR: 8077587: BigInteger Roots [v26]

2025-07-20 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Minor change - Changes: - all: https://git.openjdk.org/jdk/pull/24898/files - new: https:

Re: RFR: 8077587: BigInteger Roots [v25]

2025-07-20 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Minor change - Changes: - all: https://git.openjdk.org/jdk/pull/24898/files - new: https:

Re: RFR: 8077587: BigInteger Roots [v24]

2025-07-20 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with two additional commits since the last revision: - Removed trailingwhitespace - Revision changes Revision changes, with explanation comment for init

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-16 Thread Raffaello Giulietti
On Wed, 16 Jul 2025 10:32:41 GMT, fabioromano1 wrote: >> src/java.base/share/classes/java/math/BigInteger.java line 2755: >> >>> 2753: * is even and this BigInteger is negative, an {@code >>> ArithmeticException} will be >>> 2754: * thrown. >>> 2755: * >> >> I think this specifi

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-16 Thread fabioromano1
On Wed, 16 Jul 2025 10:01:00 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Removed useless instruction > > src/java.base/share/classes/java/math/BigInteger.java line 2755: > >> 2753:

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-16 Thread Raffaello Giulietti
On Sat, 12 Jul 2025 09:18:27 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > Removed useless instruction src/java.bas

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-14 Thread Hans Boehm
On Mon, Jul 14, 2025 at 10:14 AM fabioromano1 wrote: > > On Sat, 12 Jul 2025 09:18:27 GMT, fabioromano1 wrote: > > >> This PR implements nth root computation for BigIntegers using Newton method. > > > > fabioromano1 has updated the pull request incrementally with one additional commit since the l

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-14 Thread fabioromano1
On Mon, 14 Jul 2025 15:43:58 GMT, Raffaello Giulietti wrote: >> @rgiulietti The convergence of the recurrence is guaranteed if the initial >> estimate is larger than or equal to the exact value, AFAIK no guarantee is >> given when the estimate is smaller than the exact value. > > This is my hu

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-14 Thread fabioromano1
On Sat, 12 Jul 2025 09:18:27 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > Removed useless instruction The integers

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-14 Thread fabioromano1
On Mon, 14 Jul 2025 15:52:19 GMT, fabioromano1 wrote: > This is my hunch as well. So while the use of `nextUp()` and `ceil()` > certainly help to achieve an overestimate, I'm less sure that this is > sufficient when using `pow()`. If the latter has some error bigger than a few > ulps, then we

Re: RFR: 8077587: BigInteger Roots [v20]

2025-07-14 Thread Hans Boehm
On Fri, Jul 11, 2025 at 11:44 AM fabioromano1 wrote: > > On Fri, 11 Jul 2025 18:07:31 GMT, fabioromano1 wrote: > > >> This PR implements nth root computation for BigIntegers using Newton method. > > > > fabioromano1 has updated the pull request incrementally with one additional commit since the l

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-14 Thread fabioromano1
On Mon, 14 Jul 2025 15:43:58 GMT, Raffaello Giulietti wrote: > This is my hunch as well. So while the use of `nextUp()` and `ceil()` > certainly help to achieve an overestimate, I'm less sure that this is > sufficient when using `pow()`. If the latter has some error bigger than a few > ulps,

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-14 Thread Raffaello Giulietti
On Mon, 14 Jul 2025 15:46:47 GMT, fabioromano1 wrote: >> src/java.base/share/classes/java/math/MutableBigInteger.java line 1936: >> >>> 1934: * where {@code nthRoot(., n)} denotes the mathematical {@code >>> n}th root. >>> 1935: * The contents of {@code this} are not changed. The >>>

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-14 Thread fabioromano1
On Mon, 14 Jul 2025 14:32:45 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Removed useless instruction > > src/java.base/share/classes/java/math/MutableBigInteger.java line 1936: > >> 1

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-14 Thread Raffaello Giulietti
On Mon, 14 Jul 2025 15:40:18 GMT, fabioromano1 wrote: >> src/java.base/share/classes/java/math/MutableBigInteger.java line 1964: >> >>> 1962: final double rad = Math.nextUp(x >= 0 ? x : x + 0x1p64); >>> 1963: final double approx = n == 3 ? Math.cbrt(rad) : >>> Math.pow(r

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-14 Thread fabioromano1
On Mon, 14 Jul 2025 14:33:26 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Removed useless instruction > > src/java.base/share/classes/java/math/MutableBigInteger.java line 1964: > >> 1

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-14 Thread Raffaello Giulietti
On Sat, 12 Jul 2025 09:18:27 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > Removed useless instruction I'm looking

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-14 Thread Raffaello Giulietti
On Sat, 12 Jul 2025 09:18:27 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > Removed useless instruction I agree that

Re: RFR: 8077587: BigInteger Roots [v23]

2025-07-12 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Removed useless instruction - Changes: - all: https://git.openjdk.org/jdk/pull/24898/files

Re: RFR: 8077587: BigInteger Roots [v22]

2025-07-12 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. 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/24898/files - new:

Re: RFR: 8077587: BigInteger Roots [v21]

2025-07-11 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: small change for readability - Changes: - all: https://git.openjdk.org/jdk/pull/24898/files

Re: RFR: 8077587: BigInteger Roots [v20]

2025-07-11 Thread fabioromano1
On Fri, 11 Jul 2025 18:07:31 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > Avoid to discard fraction bits in the ini

Re: RFR: 8077587: BigInteger Roots [v20]

2025-07-11 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Avoid to discard fraction bits in the initial estimate - Changes: - all: https://git.openjd

Re: RFR: 8077587: BigInteger Roots [v19]

2025-07-11 Thread Hans Boehm
Apologies if this has been discussed before. The explanation for the exception for negative n ("This would cause the operation to yield a non-integer value.") feels wrong to me. I think the definition of the result as: x.signum() * floor(abs(nthRoot(x, n))) works fine for that case, if nthRoot(x,-

Re: RFR: 8077587: BigInteger Roots [v19]

2025-07-11 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Optimize the computation of the input's shift Optimize the computation of the input's shift, in order

Re: RFR: 8077587: BigInteger Roots [v18]

2025-07-11 Thread Raffaello Giulietti
On Fri, 6 Jun 2025 08:08:09 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > Update "since" version Right. --

Re: RFR: 8077587: BigInteger Roots [v18]

2025-07-11 Thread fabioromano1
On Fri, 11 Jul 2025 12:38:56 GMT, Raffaello Giulietti wrote: > On the other hand, the code contains about 80 lines just to find the initial > estimate. To ensure that the code is readable and maintainable, it either > needs to be documented better, possibly with math, or simplified so that the

Re: RFR: 8077587: BigInteger Roots [v18]

2025-07-11 Thread Raffaello Giulietti
On Fri, 6 Jun 2025 08:08:09 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > Update "since" version Sure, the initial

Re: RFR: 8077587: BigInteger Roots [v15]

2025-07-10 Thread fabioromano1
On Thu, 10 Jul 2025 15:21:10 GMT, Raffaello Giulietti wrote: >> @rgiulietti Regarding the tests for _n_-th root, the tests for `sqrt()` >> could be extended in order to test also `nthRoot()`. > > @fabioromano1 IIUC, the bulk of the code in the PR is aimed at finding a good > starting estimate.

Re: RFR: 8077587: BigInteger Roots [v15]

2025-07-10 Thread Raffaello Giulietti
On Sat, 17 May 2025 11:25:58 GMT, fabioromano1 wrote: >> The [Rampdown Phase One](https://openjdk.org/projects/jdk/25/) for JDK 25 is >> about 3 weeks from now. >> >> I think it's a bit too late for API additions to be approved in due time. >> And even if we could rush this work for 25, it mak

Re: RFR: 8077587: BigInteger Roots [v18]

2025-06-06 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Update "since" version - Changes: - all: https://git.openjdk.org/jdk/pull/24898/files - n

Re: RFR: 8077587: BigInteger Roots [v15]

2025-06-05 Thread Raffaello Giulietti
On Sat, 17 May 2025 11:25:58 GMT, fabioromano1 wrote: >> The [Rampdown Phase One](https://openjdk.org/projects/jdk/25/) for JDK 25 is >> about 3 weeks from now. >> >> I think it's a bit too late for API additions to be approved in due time. >> And even if we could rush this work for 25, it mak

Re: RFR: 8077587: BigInteger Roots [v17]

2025-05-19 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. 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/24898/files - new:

Re: RFR: 8077587: BigInteger Roots [v16]

2025-05-18 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Do first refinement loop only if shift == 0 - Changes: - all: https://git.openjdk.org/jdk/p

Re: RFR: 8077587: BigInteger Roots [v15]

2025-05-17 Thread fabioromano1
On Wed, 14 May 2025 18:48:50 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Revert "Use type long for bitLength instead of int" >> >> This reverts commit c8e1b8159206d9fb5532df7ccdf9

Re: RFR: 8077587: BigInteger Roots [v15]

2025-05-14 Thread fabioromano1
On Wed, 14 May 2025 18:48:50 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Revert "Use type long for bitLength instead of int" >> >> This reverts commit c8e1b8159206d9fb5532df7ccdf9

Re: RFR: 8077587: BigInteger Roots [v15]

2025-05-14 Thread Raffaello Giulietti
On Wed, 14 May 2025 18:07:08 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > Revert "Use type long for bitLength inste

Re: RFR: 8077587: BigInteger Roots [v15]

2025-05-14 Thread fabioromano1
On Wed, 14 May 2025 18:27:28 GMT, Raffaello Giulietti wrote: > I doubt that the AKS primality test is of any practical relevance, although > it's a _great_ theoretical achievement. Yes, indeed it was just an example, but the exact power detection can be used also as a test apart from the enti

Re: RFR: 8077587: BigInteger Roots [v15]

2025-05-14 Thread Raffaello Giulietti
On Wed, 14 May 2025 18:07:08 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with one additional > commit since the last revision: > > Revert "Use type long for bitLength inste

Re: RFR: 8077587: BigInteger Roots [v6]

2025-05-14 Thread fabioromano1
On Wed, 14 May 2025 17:59:59 GMT, Raffaello Giulietti wrote: > I guess this work will be the basis for a future work on `BigDecimal` _n_-th > root? @rgiulietti Yes, it is. Some use cases could be primality testing, like AKS, where part of the algorithm detect composite numbers by checking whe

Re: RFR: 8077587: BigInteger Roots [v15]

2025-05-14 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Revert "Use type long for bitLength instead of int" This reverts commit c8e1b8159206d9fb5532df7ccdf98a

Re: RFR: 8077587: BigInteger Roots [v6]

2025-05-14 Thread Raffaello Giulietti
On Mon, 12 May 2025 19:23:16 GMT, fabioromano1 wrote: >> @fabioromano1 Is [this >> proof](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) >> still relevant? > > @rgiulietti No, the proof of the recurrence used is the one by Zimmermann > linked in the code

Re: RFR: 8077587: BigInteger Roots [v14]

2025-05-14 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Use type long for bitLength instead of int - Changes: - all: https://git.openjdk.org/jdk/pu

Re: RFR: 8077587: BigInteger Roots [v13]

2025-05-13 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. 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/24898/files - new:

Re: RFR: 8077587: BigInteger Roots [v12]

2025-05-13 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with two additional commits since the last revision: - Merge branch 'nth-root-branch' of https://github.com/fabioromano1/jdk into nth-root-branch - Compute re

Re: RFR: 8077587: BigInteger Roots [v11]

2025-05-13 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Avoid needless box/unbox conversion - Changes: - all: https://git.openjdk.org/jdk/pull/2489

Re: RFR: 8077587: BigInteger Roots [v10]

2025-05-12 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with two additional commits since the last revision: - Merge branch 'nth-root-branch' of https://github.com/fabioromano1/jdk into nth-root-branch - correct an

Re: RFR: 8077587: BigInteger Roots [v9]

2025-05-12 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Removed useless code - Changes: - all: https://git.openjdk.org/jdk/pull/24898/files - new

Re: RFR: 8077587: BigInteger Roots [v8]

2025-05-12 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: correct typos - Changes: - all: https://git.openjdk.org/jdk/pull/24898/files - new: https

Re: RFR: 8077587: BigInteger Roots [v7]

2025-05-12 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Factor out newton's recurrence in a separate method - Changes: - all: https://git.openjdk.o

Re: RFR: 8077587: BigInteger Roots [v6]

2025-05-12 Thread fabioromano1
On Mon, 12 May 2025 17:37:54 GMT, Raffaello Giulietti wrote: >> fabioromano1 has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Merge branch 'nth-root-branch' of https://github.com/fabioromano1/jdk >> into nth-root-branch >> - Restore

Re: RFR: 8077587: BigInteger Roots [v6]

2025-05-12 Thread Raffaello Giulietti
On Sat, 10 May 2025 11:57:32 GMT, fabioromano1 wrote: >> This PR implements nth root computation for BigIntegers using Newton method. > > fabioromano1 has updated the pull request incrementally with two additional > commits since the last revision: > > - Merge branch 'nth-root-branch' of https

Re: RFR: 8077587: BigInteger Roots [v6]

2025-05-10 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request incrementally with two additional commits since the last revision: - Merge branch 'nth-root-branch' of https://github.com/fabioromano1/jdk into nth-root-branch - Restore nt

Re: RFR: 8077587: BigInteger Roots [v5]

2025-05-10 Thread fabioromano1
> This PR implements nth root computation for BigIntegers using Newton method. fabioromano1 has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 44 commits: - Merge branch 'openjdk:master' into nth-root-branch - Update to resolve conflic

Re: RFR: 8077587: BigInteger Roots [v4]

2025-04-27 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). fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: An optimization -

Re: RFR: 8077587: BigInteger Roots [v3]

2025-04-27 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). fabioromano1 has updated the pull request incrementally with one additional commit since the last revision: Correct unsigned division

Re: RFR: 8077587: BigInteger Roots [v2]

2025-04-27 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). fabioromano1 has updated the pull request incrementally with two additional commits since the last revision: - Correct typo in comment

Re: RFR: 8077587: BigInteger Roots [v33]

2025-04-26 Thread fabioromano1
> This PR optimizes `BigInteger.pow(int)` method. The primary enhancement in > `pow()` is not concerned most on execution time, but rather in memory > optimization, because the PR implementation does the "shift of the exponent" > squaring the result rather than the base, so the base is not squar

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 by the merg

Re: RFR: 8077587: BigInteger Roots [v19]

2025-04-26 Thread Chen Liang
On Thu, 24 Apr 2025 20:18:42 GMT, fabioromano1 wrote: >> @fabioromano1 I just had a cursory glance at this PR. >> >> AFAIU, there are two main contributions here: >> >> - Performance enhancements in `pow()`, which is of general interest and does >> not require submitting a [CSR](https://wiki.o

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 [v19]

2025-04-24 Thread Raffaello Giulietti
On Mon, 21 Apr 2025 11:47:30 GMT, fabioromano1 wrote: >>> [Here is a proof of convergence of the recurrence >>> used.](https://github.com/user-attachments/files/19785045/nth_root_newton_proof_integers.pdf) >> >> That's very nice. It would be even nicer if this was a permalink into the >> JDK r

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) fabioromano1 has updat

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) fabioromano1 has updat

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) fabioromano1 has updat

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) fabioromano1 has updat

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) fabioromano1 has updat

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) fabioromano1 has updat

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) fabioromano1 has updat

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) fabioromano1 has updat

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) fabioromano1 has updat

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) fabioromano1 has updat

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) fabioromano1 has updat

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) fabioromano1 has updat

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/MutableBigInteger.java line 1924: > >> 1922: * @imp

  1   2   >