Re: pgsql: Add support for hyperbolic functions, as well as log10().

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, laetitia(dot)avrot(at)gmail(dot)com
Subject: Re: pgsql: Add support for hyperbolic functions, as well as log10().
Date: 2019-03-14 00:48:49
Message-ID: 27340.1552524529@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)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

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2019-03-14 01:05:41 pgsql: Adjust the tests for the hyperbolic functions.
Previous Message Dean Rasheed 2019-03-14 00:35:30 Re: pgsql: Add support for hyperbolic functions, as well as log10().

Browse pgsql-hackers by date

  From Date Subject
Next Message John Naylor 2019-03-14 01:38:33 Re: WIP: Avoid creation of the free space map for small tables
Previous Message Dean Rasheed 2019-03-14 00:35:30 Re: pgsql: Add support for hyperbolic functions, as well as log10().