RE: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-06-17 Thread Anthony Vanelverdinghe
-April/059783.html From: Raffaello Giulietti Sent: Monday, June 17, 2019 4:56:22 PM To: Anthony Vanelverdinghe; core-libs-dev Subject: Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results Hi Anthony, On 16/06/2019 19.17, Anthony

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-06-17 Thread Raffaello Giulietti
Hi Anthony, On 16/06/2019 19.17, Anthony Vanelverdinghe wrote: Hi Raffaello While I don't have feedback on the actual math, here's a few suggestions: - there's some use of non-ASCII characters in the patch. I don't think this is common in the JDK's Java sources, so you might want to replace

RE: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-06-16 Thread Anthony Vanelverdinghe
Hi Raffaello While I don't have feedback on the actual math, here's a few suggestions: - there's some use of non-ASCII characters in the patch. I don't think this is common in the JDK's Java sources, so you might want to replace them with their Unicode escapes. The characters are: ≤

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-04-19 Thread Raffaello Giulietti
n in java.io.IOError? From: core-libs-dev on behalf of Raffaello Giulietti Sent: Thursday, April 18, 2019 3:37 PM To: Brian Burkhalter; core-libs-dev Subject: Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results Hi, On 1

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-04-19 Thread Jason Mehrens
-dev Subject: Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results Hi, On 18.04.19 21:29, Brian Burkhalter wrote: > >> On Apr 18, 2019, at 11:44 AM, Raffaello Giulietti >> > <mailto:raffaello.giulie...@gmail.com>> wrote: >> >> he

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-04-18 Thread Raffaello Giulietti
Hi, On 18.04.19 21:29, Brian Burkhalter wrote: On Apr 18, 2019, at 11:44 AM, Raffaello Giulietti > wrote: here's another revision of the patch. Its purpose is to overcome the test failure observed in [1]. To this end, the patch adds

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-04-18 Thread Brian Burkhalter
> On Apr 18, 2019, at 11:44 AM, Raffaello Giulietti > wrote: > > here's another revision of the patch. Its purpose is to overcome the test > failure observed in [1]. To this end, the patch adds > > FloatToDecimal.appendTo(float, Appendable) and > DoubleToDecimal.appendTo(double, Appendable)

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-04-03 Thread Brian Burkhalter
Hi Raffaello, et. al. > On Apr 3, 2019, at 7:43 AM, Raffaello Giulietti > wrote: > > in this patch there are additional white-box tests against critical package > private entities in the jdk.internal.math classes. In particular the class > jdk.internal.math.MathUtils is thoroughly tested. >

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-03-14 Thread Brian Burkhalter
The CSR for this issue is available for review at https://bugs.openjdk.java.net/browse/JDK-8202555 . If you have a JBS user name you can add yourself as reviewer by editing the issue directly, assuming you concur with the content. Brian > On

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-03-08 Thread raffaello . giulietti
On 2019-03-08 14:35, Andrew Haley wrote: > Hi, > > On 3/7/19 7:16 PM, Raffaello Giulietti wrote: > >> a couple of weeks ago I tried to refactor the code assuming the >> existence of unsignedMultiplyHigh() (either as some future intrinsic or >> as a Java method) and a wider representations of g

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-03-08 Thread Andrew Haley
Hi, On 3/7/19 7:16 PM, Raffaello Giulietti wrote: > a couple of weeks ago I tried to refactor the code assuming the > existence of unsignedMultiplyHigh() (either as some future intrinsic or > as a Java method) and a wider representations of g with either 127 or > 128 bits: > g = g1 2^64

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-03-08 Thread Brian Burkhalter
> On Mar 7, 2019, at 6:01 PM, Andrew Haley wrote: > > On 3/7/19 10:10 AM, Brian Burkhalter wrote: >> >>> On Mar 7, 2019, at 10:04 AM, Andrew Haley >> > wrote: >>> >>> I still believe you'd be better off defining an unsigned multiplyHigh than >>> all that messing about

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-03-07 Thread Raffaello Giulietti
On 2019-03-07 11:10, Brian Burkhalter wrote: On Mar 7, 2019, at 10:04 AM, Andrew Haley > wrote: On 3/6/19 7:31 PM,raffaello.giulie...@gmail.com wrote: the latest version of the patch, replacing the one found at [1]. In the next

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-03-07 Thread Andrew Haley
On 3/7/19 10:10 AM, Brian Burkhalter wrote: > >> On Mar 7, 2019, at 10:04 AM, Andrew Haley wrote: >> >> I still believe you'd be better off defining an unsigned multiplyHigh than >> all that messing about with shifts and masks in rop(). > > There is in fact an open issue for unsigned

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-03-07 Thread Brian Burkhalter
> On Mar 7, 2019, at 10:04 AM, Andrew Haley wrote: > > On 3/6/19 7:31 PM, raffaello.giulie...@gmail.com > wrote: >> the latest version of the patch, replacing the one found at [1]. >> In the next days, my sponsor Brian Burkhalter will publish it as a

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-03-07 Thread Andrew Haley
On 3/6/19 7:31 PM, raffaello.giulie...@gmail.com wrote: > the latest version of the patch, replacing the one found at [1]. > In the next days, my sponsor Brian Burkhalter will publish it as a webrev. I still believe you'd be better off defining an unsigned multiplyHigh than all that messing about

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2019-03-07 Thread Brian Burkhalter
The corresponding webrev may be viewed at [1]. Thanks, Brian [1] http://cr.openjdk.java.net/~bpb/4511638/webrev.01/ > On Mar 6, 2019, at 7:31 PM, raffaello.giulie...@gmail.com > wrote: > > the latest

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-10-24 Thread Brian Burkhalter
Hello, I think I neglected to post the link here before, but the Compatibility and Specification Request (CSR) corresponding to this issue is at [2]. It has a specdiff attached to it which would be helpful in comparing the changes to the javadoc specification of {Double,Float}.toString(). Any

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-10-04 Thread raffaello . giulietti
On 2018-10-04 15:28, Ulf Adams wrote: > On Thu, Sep 27, 2018 at 5:37 PM Raffaello Giulietti > mailto:raffaello.giulie...@gmail.com>> > wrote: > > Hi Ulf, > > > On 2018-09-27 16:40, Ulf Adams wrote: > > Hi Raffaello, > > > > I am the author of a recent publication on double

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-10-04 Thread raffaello . giulietti
On 2018-10-03 11:12, Andrew Dinn wrote: > On 02/10/18 19:17, Martin Buchholz wrote: >> Raffaello and Ulf should talk. >> It seems like Ulf's ryu project is trying to solve the same problem. >> ryu is also still being worked on, but there is already a published paper >> and ryu is being adopted by

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-10-04 Thread raffaello . giulietti
Hi, On 2018-10-02 20:17, Martin Buchholz wrote: > Raffaello and Ulf should talk. I work on this project in my spare time, which is limited and not entirely devoted to programming for the OpenJDK, of course ;-) Starting this weekend, I'll try to recollect my notes and organize them in paper or

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-10-04 Thread Ulf Adams
On Thu, Sep 27, 2018 at 5:37 PM Raffaello Giulietti < raffaello.giulie...@gmail.com> wrote: > Hi Ulf, > > > On 2018-09-27 16:40, Ulf Adams wrote: > > Hi Raffaello, > > > > I am the author of a recent publication on double to string conversion > > [1] - the Ryu algorithm. I've been aware of the

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-10-03 Thread Andrew Dinn
On 02/10/18 19:17, Martin Buchholz wrote: > Raffaello and Ulf should talk. > It seems like Ulf's ryu project is trying to solve the same problem. > ryu is also still being worked on, but there is already a published paper > and ryu is being adopted by various core libraries. >

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-10-02 Thread Martin Buchholz
Raffaello and Ulf should talk. It seems like Ulf's ryu project is trying to solve the same problem. ryu is also still being worked on, but there is already a published paper and ryu is being adopted by various core libraries. https://github.com/ulfjack/ryu

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-28 Thread Dmitry Nadezhin
I would like to tell about some steps towards formal check of Raffaello's human proof. I work on formal verification of some Oracle projects but they are unrelated to JDK. In April Brian Burkhalter requested me to review the Raffaello's paper. His paper is smart and clear but nevertheless I was

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-27 Thread Brian Burkhalter
On Sep 27, 2018, at 9:00 AM, Raffaello Giulietti wrote: > On 2018-09-27 17:53, Andrew Dinn wrote: >> On 27/09/18 16:37, Raffaello Giulietti wrote: >> . . . >>> I thank you in advance for your willingness to review the code but my >>> understanding is that only the officially appointed

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-27 Thread Raffaello Giulietti
On 2018-09-27 17:53, Andrew Dinn wrote: On 27/09/18 16:37, Raffaello Giulietti wrote: . . . I thank you in advance for your willingness to review the code but my understanding is that only the officially appointed reviewers can approve OpenJDK contributions, which is of course a good policy.

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-27 Thread Andrew Dinn
On 27/09/18 16:37, Raffaello Giulietti wrote: . . . > I thank you in advance for your willingness to review the code but my > understanding is that only the officially appointed reviewers can > approve OpenJDK contributions, which is of course a good policy. > Besides, as two Andrews engineers

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-27 Thread Raffaello Giulietti
Hi Ulf, On 2018-09-27 16:40, Ulf Adams wrote: Hi Raffaello, I am the author of a recent publication on double to string conversion [1] - the Ryu algorithm. I've been aware of the problems with the Jdk for several years, and am very much looking forward to improvements in correctness and

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-27 Thread Raffaello Giulietti
On 2018-09-27 16:55, Andrew Dinn wrote: Hi Raffaello, On 27/09/18 15:20, raffaello.giulie...@gmail.com wrote: Hi Andrew, On the other side, in April this year I submitted another quite fast and supposedly correct algorithm on this mailing list and I referred to an accompanying paper by myself

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-27 Thread Andrew Dinn
Hi Raffaello, On 27/09/18 15:20, raffaello.giulie...@gmail.com wrote: > Hi Andrew, > On the other side, in April this year I submitted another quite fast and > supposedly correct algorithm on this mailing list and I referred to an > accompanying paper by myself that gives full explanations on

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-27 Thread Ulf Adams
Hi Raffaello, I am the author of a recent publication on double to string conversion [1] - the Ryu algorithm. I've been aware of the problems with the Jdk for several years, and am very much looking forward to improvements in correctness and performance in this area. I have done some testing

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-27 Thread raffaello . giulietti
Hi Andrew, On 2018-09-27 15:28, Andrew Haley wrote: > On 09/27/2018 01:23 PM, Raffaello Giulietti wrote: > >> In principle I agree with you. >> >> However, in this case the maths underlying the algorithm to select the >> decimal are too involved to explain in comment form. I'm in the course >>

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-27 Thread raffaello . giulietti
Hi Andrew, On 2018-09-27 14:57, Andrew Dinn wrote: > On 27/09/18 13:23, Raffaello Giulietti wrote: > . . . >> The comments of the accessor methods that make use of this private table >> implicitly explain its semantics as well. I will add a comment to the >> field that refers to the comments

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-27 Thread Andrew Haley
On 09/27/2018 01:23 PM, Raffaello Giulietti wrote: > In principle I agree with you. > > However, in this case the maths underlying the algorithm to select the > decimal are too involved to explain in comment form. I'm in the course > of preparing a paper that explains the idea and the details.

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-27 Thread Andrew Dinn
On 27/09/18 13:23, Raffaello Giulietti wrote: . . . > The comments of the accessor methods that make use of this private table > implicitly explain its semantics as well. I will add a comment to the > field that refers to the comments in the methods. > > > How the table was generated and

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-27 Thread Raffaello Giulietti
Hi Andrew, In principle I agree with you. However, in this case the maths underlying the algorithm to select the decimal are too involved to explain in comment form. I'm in the course of preparing a paper that explains the idea and the details. Then it should be easier to make sense out of

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-27 Thread Andrew Haley
On 09/26/2018 06:39 PM, raffaello.giulie...@gmail.com wrote: > The submitted code contains both the changes to the current > implementation and extensive jtreg tests. > > While I've struggled to keep the code within the 80 chars/line limit, > mercurial still generates longer lines. Thus, to avoid

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-27 Thread Raffaello Giulietti
Hi Brian, On 2018-09-27 01:53, Brian Burkhalter wrote: There was a compilation error on Linux in one of the tests: test/jdk/java/lang/Floating/DoubleToDecString.java:133: error: unmappable character (0x93) for encoding US-ASCII Paxson V, "A Program for Testing IEEE

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-26 Thread Brian Burkhalter
There was a compilation error on Linux in one of the tests: test/jdk/java/lang/Floating/DoubleToDecString.java:133: error: unmappable character (0x93) for encoding US-ASCII Paxson V, "A Program for Testing IEEE Decimal\ufffd\ufffd\ufffdBinary Conversion" This was only in one of the

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-26 Thread Brian Burkhalter
On Sep 26, 2018, at 11:24 AM, Brian Burkhalter wrote: >> Since there's a change in the specification, according to my sponsor and >> the formalities it has to undergo a CSR. > > I will update the CSR. I updated the CSR [1] with the new verbiage for Double.toString() and Float.toString() and

Re: [PATCH] 4511638: Double.toString(double) sometimes produces incorrect results

2018-09-26 Thread Brian Burkhalter
Hi Raffaello, Here is the webrev version of the patch: http://cr.openjdk.java.net/~bpb/4511638/webrev.00/ On Sep 26, 2018, at 10:39 AM, raffaello.giulie...@gmail.com wrote: > To address and overcome both issues, a new specification in the form of > Javadoc associated to Double.toString(double)