Re: pgsql: Add support for hyperbolic functions, as well as log10(). - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pgsql: Add support for hyperbolic functions, as well as log10().
Date
Msg-id 27340.1552524529@sss.pgh.pa.us
Whole thread Raw
In response to Re: pgsql: Add support for hyperbolic functions, as well as log10().  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: pgsql: Add support for hyperbolic functions, as well as log10().
List pgsql-hackers
Dean Rasheed <dean.a.rasheed@gmail.com> writes:
> It's not unreasonable to expect these functions to be accurate to within
> the last 1 or 2 digits, so testing with extra_float_digits or whatever
> seems reasonable, but I think a wider variety of test inputs is required.

Meh.  As I said before, we're not in the business of improving on what
libm does --- if someone has a beef with the results, they need to take
it to their platform's libm maintainer, not us.  The point of testing
this at all is just to ensure that we've wired up the SQL functions
to the library functions correctly.

> I also wonder if we should be doing what we do for the regular trig
> functions and explicitly handle special cases like Inf and NaN to ensure
> POSIX compatibility on all platforms.

I'm not too excited about this, but perhaps it would be interesting to
throw in tests of the inf/nan cases temporarily, just to see how big
a problem there is of that sort.  If the answer comes out to be
"all modern platforms get this right", I don't think it's our job to
clean up after the stragglers.  But if the answer is not that, maybe
I could be talked into spending code on it.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: pgsql: Add support for hyperbolic functions, as well as log10().
Next
From: John Naylor
Date:
Subject: Re: WIP: Avoid creation of the free space map for small tables