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

From: Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:35:30
Message-ID: CAEZATCX-mFwmx0NKbGsYJ6RAo8Hb=c+_CeNNXWQ7-BmK2_XVWw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

On Wed, 13 Mar 2019, 21:56 Tom Lane, <tgl(at)sss(dot)pgh(dot)pa(dot)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

>

In response to

Responses

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2019-03-14 00:48:49 Re: pgsql: Add support for hyperbolic functions, as well as log10().
Previous Message Michael Paquier 2019-03-14 00:33:42 Re: pgsql: Use condition variables to wait for checkpoints.

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2019-03-14 00:48:49 Re: pgsql: Add support for hyperbolic functions, as well as log10().
Previous Message Michael Paquier 2019-03-14 00:23:42 Re: Offline enabling/disabling of data checksums