Re: Add error functions: erf() and erfc()

2023-03-08 Thread Thomas Munro
On Thu, Mar 9, 2023 at 1:16 PM Dean Rasheed wrote: > On Wed, 8 Mar 2023 at 23:24, Thomas Munro wrote: > > ... But Oracle, and I think > > several other analytics-focused SQL systems, can do it in a very easy > > built-in way. I think to get at that you probably need the t CDF, and > > in

Re: Add error functions: erf() and erfc()

2023-03-08 Thread Nathan Bossart
On Thu, Mar 09, 2023 at 12:27:47AM +, Dean Rasheed wrote: > On Thu, 9 Mar 2023 at 00:13, Nathan Bossart wrote: >> I'm also wondering about whether we need the isinf() checks. IIUC that >> should never happen, but maybe you added that "just in case." > > I copied those from dtanh(),

Re: Add error functions: erf() and erfc()

2023-03-08 Thread Dean Rasheed
On Thu, 9 Mar 2023 at 00:13, Nathan Bossart wrote: > > On Wed, Mar 08, 2023 at 11:29:12PM +, Dean Rasheed wrote: > > On Wed, 8 Mar 2023 at 20:11, Nathan Bossart > > wrote: > >> The man pages for these seem to indicate that underflow can occur. Do we > >> need to check for that? > > > > No,

Re: Add error functions: erf() and erfc()

2023-03-08 Thread Dean Rasheed
On Wed, 8 Mar 2023 at 23:24, Thomas Munro wrote: > > No comment on the maths, but I'm pretty sure we won't need a fallback > implementation. That stuff goes back to the math libraries of 80s > Unixes, even though it didn't make it into C until '99. I just > checked the man pages for all our

Re: Add error functions: erf() and erfc()

2023-03-08 Thread Nathan Bossart
On Wed, Mar 08, 2023 at 11:29:12PM +, Dean Rasheed wrote: > On Wed, 8 Mar 2023 at 20:11, Nathan Bossart wrote: >> The man pages for these seem to indicate that underflow can occur. Do we >> need to check for that? > > No, I don't think so. The docs indicate that if an underflow occurs, >

Re: Add error functions: erf() and erfc()

2023-03-08 Thread Dean Rasheed
On Wed, 8 Mar 2023 at 20:11, Nathan Bossart wrote: > > On Mon, Feb 27, 2023 at 12:54:35PM +, Dean Rasheed wrote: > > + /* > > + * For erf, we don't need an errno check because it never overflows. > > + */ > > > + /* > > + * For erfc, we don't need an errno check because

Re: Add error functions: erf() and erfc()

2023-03-08 Thread Thomas Munro
On Tue, Feb 28, 2023 at 1:54 AM Dean Rasheed wrote: > Now that we have random_normal(), it seems like it would be useful to > add the error functions erf() and erfc(), which I think are > potentially useful to the people who will find random_normal() useful, > and pos

Re: Add error functions: erf() and erfc()

2023-03-08 Thread Nathan Bossart
On Mon, Feb 27, 2023 at 12:54:35PM +, Dean Rasheed wrote: > + /* > + * For erf, we don't need an errno check because it never overflows. > + */ > + /* > + * For erfc, we don't need an errno check because it never overflows. > + */ The man pages for these seem to

Add error functions: erf() and erfc()

2023-02-27 Thread Dean Rasheed
Now that we have random_normal(), it seems like it would be useful to add the error functions erf() and erfc(), which I think are potentially useful to the people who will find random_normal() useful, and possibly others. An immediate use for erf() is that it allows us to do a Kolmogorov-Smirnov