Re: pgsql: Add support for hyperbolic functions, as well as log10().
Dean Rasheed <dean.a.rasheed@gmail.com>
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Michael Paquier <michael@paquier.xyz>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>,
laetitia.avrot@gmail.com
Date: 2019-03-14T00:35:30Z
Lists: pgsql-hackers
On Wed, 13 Mar 2019, 21:56 Tom Lane, <tgl@sss.pgh.pa.us> wrote: > > Of these, probably the least bad is #3, even though it might require > a few rounds of experimentation to find the best extra_float_digits > setting to use. I'll go try it without any roundoff, just to see > what the raw results look like ... > Yeah, that seems like a reasonable thing to try. I'm amazed that jacana's asinh() returned -0 for an input of +0. I'm not aware of any implementation that does that. I'd be quite interested to know what it returned for an input like 1e-20. If that returned any variety of zero, I'd say that it's worse than useless. Another interesting test case would be whether or not it satisfies asinh(-x) = -asinh(x) for a variety of different values of x, because that's something that commonly breaks down badly with naive implementations. 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. 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. Regards, Dean >
Commits
-
Further adjust the tests for the hyperbolic functions.
- c43ecdee0fff 12.0 landed
-
Adjust the tests for the hyperbolic functions.
- c015f853bf59 12.0 landed
-
Rethink how to test the hyperbolic functions.
- c6f153dcfebc 12.0 landed
-
Add support for hyperbolic functions, as well as log10().
- f1d85aa98ee7 12.0 cited