Re: RFR: 8339934: Simplify Math.scalb(double) method [v3]

2024-09-16 Thread Joe Darcy
On Fri, 13 Sep 2024 19:33:51 GMT, Raffaello Giulietti wrote: >> `Math.scalb(double)` can be simplified, removing a loop and using >> larger/smaller factors. > > Raffaello Giulietti has updated the pull request incrementally with one > additional commit since the last revision: > > Introduce

Re: RFR: 8339934: Simplify Math.scalb(double) method [v3]

2024-09-13 Thread Raffaello Giulietti
> `Math.scalb(double)` can be simplified, removing a loop and using > larger/smaller factors. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Introduce primPowerOfTwoD and make use of it. - Changes: - all: http

Re: RFR: 8339934: Simplify Math.scalb(double) method [v2]

2024-09-13 Thread Joe Darcy
On Fri, 13 Sep 2024 18:56:35 GMT, Raffaello Giulietti wrote: > I considered using `powerOfTwoD` but it uses a `long` `+`, and performs an > additional masking which seems useless or over-cautious and does not help if > `n` is out of range (assuming the assert is not enabled). > > What about a

Re: RFR: 8339934: Simplify Math.scalb(double) method [v2]

2024-09-13 Thread Raffaello Giulietti
On Fri, 13 Sep 2024 18:44:36 GMT, Joe Darcy wrote: >> Raffaello Giulietti has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Slight improvement. > > src/java.base/share/classes/java/lang/Math.java line 3325: > >> 3323: if (scaleFac

Re: RFR: 8339934: Simplify Math.scalb(double) method [v2]

2024-09-13 Thread Joe Darcy
On Fri, 13 Sep 2024 08:56:39 GMT, Raffaello Giulietti wrote: >> `Math.scalb(double)` can be simplified, removing a loop and using >> larger/smaller factors. > > Raffaello Giulietti has updated the pull request incrementally with one > additional commit since the last revision: > > Slight im

Re: RFR: 8339934: Simplify Math.scalb(double) method [v2]

2024-09-13 Thread Raffaello Giulietti
> `Math.scalb(double)` can be simplified, removing a loop and using > larger/smaller factors. Raffaello Giulietti has updated the pull request incrementally with one additional commit since the last revision: Slight improvement. - Changes: - all: https://git.openjdk.org/jdk/pu

Re: RFR: 8339934: Simplify Math.scalb(double) method

2024-09-11 Thread Raffaello Giulietti
On Wed, 11 Sep 2024 12:45:50 GMT, Raffaello Giulietti wrote: > `Math.scalb(double)` can be simplified, removing a loop and using > larger/smaller factors. The proposed implementation is even about 1.5x faster, but that's not the point of this PR. The point is to have simpler logic. Similar lo