Re: [Patch] Log10 and hyperbolic functions for SQL:2016 compliance

From: Lætitia Avrot <laetitia(dot)avrot(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [Patch] Log10 and hyperbolic functions for SQL:2016 compliance
Date: 2019-02-11 17:44:41
Message-ID: CAB_COdgvguRHKS_hTZ=4tjf1nO3fefR3=8Pf3JbQPgrwa2DGHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

Hi Andrew and Tom,

I considered that option before writing my patch but I refrained for 2
reasons:

- There is no consensus about how to name these functions. The standard
8000-2 goes with arsinh, arcosh and artanh,
but you will find easily arcsinh, arccosh and arctanh or even argsinh,
argcosh and argtanh. In IT, the names asinh,
acosh and atanh are commonly used too. We might implement them with
asinh, acosh and atanh names and add
aliases if SQL standard decide to add it under other names though.
- If we go with inverse hyperbolic functions, I guess we could add other
hyperbolic functions as hyperbolic cosecant,
secant and cotangent too. Then it adds the inverse hyperbolic functions
of these three functions. These six functions
are not described in math.h library. I guess it's because these functions
are quite simple to deduce from the others.

So, as you're asking that too, maybe my reasons weren't good enough. You'll
find enclosed a new version of the patch
with asinh, acosh and atanh (v5).

Then I tried for several days to implement the 6 last hyperbolic functions,
but I wasn't satisfied with the result, so I just dropped it.

Cheers,

Lætitia

Le dim. 3 févr. 2019 à 16:12, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> a écrit :

> Andrew Gierth <andrew(at)tao11(dot)riddles(dot)org(dot)uk> writes:
> > The spec doesn't require the inverse functions (asinh, acosh, atanh),
> > but surely there is no principled reason to omit them?
>
> +1 --- AFAICS, the C library has offered all six since C89.
>
> regards, tom lane
>

--
*Think! Do you really need to print this email ? *
*There is no Planet B.*

Attachment Content-Type Size
adding_log10_and_hyperbolic_functions_v5.patch text/x-patch 11.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2019-02-11 18:50:03 Re: Too rigorous assert in reorderbuffer.c
Previous Message John Naylor 2019-02-11 17:18:28 Re: WIP: Avoid creation of the free space map for small tables