Re: Some improvements to numeric sqrt() and ln()

2020-03-25 Thread Tom Lane
Dean Rasheed writes: > Here is an updated patch with the following updates based on your comments: This resolves all my concerns. I've marked it RFC in the CF app. regards, tom lane

Re: Some improvements to numeric sqrt() and ln()

2020-03-25 Thread Dean Rasheed
On Sun, 22 Mar 2020 at 22:16, Tom Lane wrote: > > With resolutions of the XXX items, I think this'd be committable. > Thanks for looking at this! Here is an updated patch with the following updates based on your comments: * Now uses integer arithmetic to compute res_weight and res_ndigits, inst

Re: Some improvements to numeric sqrt() and ln()

2020-03-22 Thread Tom Lane
Tels writes: > This can be reformulated as: > + * If r < 0 Then > + * Let r = r + s > + * Let s = s - 1 > + * Let r = r + s Here's a v3 that * incorporates Tels' idea; * improves some of the comments

Re: Some improvements to numeric sqrt() and ln()

2020-03-19 Thread Tom Lane
Dean Rasheed writes: > On Wed, 4 Mar 2020 at 14:41, David Steele wrote: >> Are these improvements targeted at PG13 or PG14? This seems a pretty >> big change for the last CF of PG13. > Well of course that's not entirely up to me, but I was hoping to > commit it for PG13. > It's very well cover

Re: Some improvements to numeric sqrt() and ln()

2020-03-04 Thread Dean Rasheed
On Wed, 4 Mar 2020 at 14:41, David Steele wrote: > > Are these improvements targeted at PG13 or PG14? This seems a pretty > big change for the last CF of PG13. > Well of course that's not entirely up to me, but I was hoping to commit it for PG13. It's very well covered by a large number of regr

Re: Some improvements to numeric sqrt() and ln()

2020-03-04 Thread David Steele
Hi Dean, On 2/28/20 3:15 AM, Dean Rasheed wrote: Attached is a WIP patch to improve the performance of numeric sqrt() and ln(), which also makes a couple of related improvements to div_var_fast(), all of which have knock-on benefits for other numeric functions. The actual impact varies greatly d

Re: Some improvements to numeric sqrt() and ln()

2020-03-03 Thread Dean Rasheed
On Tue, 3 Mar 2020 at 00:17, Tels wrote: > > Thank you for these patches, these sound like really nice improvements. Thanks for looking! > One thing can to my mind while reading the patch: > > +* If r < 0 Then > +* Let r = r + 2*s - 1 > +

Re: Some improvements to numeric sqrt() and ln()

2020-03-02 Thread Tels
Dear Dean, On 2020-03-01 20:47, Dean Rasheed wrote: On Fri, 28 Feb 2020 at 08:15, Dean Rasheed wrote: It's possible that there are further gains to be had in the sqrt() algorithm on platforms that support 128-bit integers, but I haven't had a chance to investigate that yet. Rebased patch a

Re: Some improvements to numeric sqrt() and ln()

2020-03-01 Thread Dean Rasheed
On Fri, 28 Feb 2020 at 08:15, Dean Rasheed wrote: > > It's possible that there are further gains to be had in the sqrt() > algorithm on platforms that support 128-bit integers, but I haven't > had a chance to investigate that yet. > Rebased patch attached, now using 128-bit integers for part of s