From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Peter Eisentraut <peter_e(at)gmx(dot)net> |
Cc: | Dean Rasheed <dean(dot)a(dot)rasheed(at)gmail(dot)com>, Noah Misch <noah(at)leadboat(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [COMMITTERS] pgsql: Add trigonometric functions that work in degrees. |
Date: | 2016-04-22 00:18:31 |
Message-ID: | 9748.1461284311@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers pgsql-hackers |
Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> On 04/19/2016 04:48 PM, Tom Lane wrote:
>> Pushed. Peter, what results do you get from these tests on your
>> problematic machine?
> acosd(x),
> acosd(x) IN (0,60,90,120,180) AS acosd_exact
> FROM (VALUES (-1), (-0.5), (0), (0.5), (1)) AS t(x);
> - x | asind | asind_exact | acosd | acosd_exact
> -------+-------+-------------+-------+-------------
> - -1 | -90 | t | 180 | t
> - -0.5 | -30 | t | 120 | t
> - 0 | 0 | t | 90 | t
> - 0.5 | 30 | t | 60 | t
> - 1 | 90 | t | 0 | t
> + x | asind | asind_exact | acosd | acosd_exact
> +------+----------------------+-------------+-------+-------------
> + -1 | -90 | t | 180 | t
> + -0.5 | -29.9999999999999964 | f | 120 | t
> + 0 | 0 | t | 90 | t
> + 0.5 | 29.9999999999999964 | f | 60 | t
> + 1 | 90 | t | 0 | t
> (5 rows)
> This is the same under the default -O2 and under -O0.
Hm. This seems to prove that we're not getting exactly 1.0 from
(asin(x) / asin_0_5) with x = 0.5, but I'm having a hard time guessing
why that might be so when all the other cases work.
Could you send along the assembler code generated by the compiler (-S
output) for float.c? Maybe that would shed some light. Probably the
-O0 version would be easier to read.
regards, tom lane
From | Date | Subject | |
---|---|---|---|
Next Message | Tom Lane | 2016-04-22 03:17:47 | pgsql: Fix unexpected side-effects of operator_precedence_warning. |
Previous Message | Tom Lane | 2016-04-22 00:06:17 | pgsql: Fix planner failure with full join in RHS of left join. |
From | Date | Subject | |
---|---|---|---|
Next Message | Andres Freund | 2016-04-22 00:21:07 | Re: kqueue |
Previous Message | Tom Lane | 2016-04-21 23:20:10 | Re: max_parallel_degree > 0 for 9.6 beta |