Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1atOpK-0002eH-K2 for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Apr 2016 00:20:06 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1atOpK-00017f-6i for pgsql-hackers@arkaria.postgresql.org; Fri, 22 Apr 2016 00:20:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1atOnz-0007y3-3P for pgsql-hackers@postgresql.org; Fri, 22 Apr 2016 00:18:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1atOnv-0002E4-WF for pgsql-hackers@postgresql.org; Fri, 22 Apr 2016 00:18:42 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u3M0IV4T009749; Thu, 21 Apr 2016 20:18:31 -0400 From: Tom Lane To: Peter Eisentraut cc: Dean Rasheed , Noah Misch , Michael Paquier , Robert Haas , "pgsql-hackers@postgresql.org" Subject: Re: [COMMITTERS] pgsql: Add trigonometric functions that work in degrees. In-reply-to: <57192E3C.9040109@gmx.net> References: <570311F1.6020902@gmx.net> <31479.1460152130@sss.pgh.pa.us> <5714552B.5030001@gmx.net> <12238.1460985466@sss.pgh.pa.us> <20160419021144.GA1984253@tornado.leadboat.com> <20830.1461032579@sss.pgh.pa.us> <20160419024950.GB1983345@tornado.leadboat.com> <32425.1461038215@sss.pgh.pa.us> <20160419041631.GC1983345@tornado.leadboat.com> <18241.1461073100@sss.pgh.pa.us> <12182.1461098908@sss.pgh.pa.us> <57192E3C.9040109@gmx.net> Comments: In-reply-to Peter Eisentraut message dated "Thu, 21 Apr 2016 15:47:08 -0400" Date: Thu, 21 Apr 2016 20:18:31 -0400 Message-ID: <9748.1461284311@sss.pgh.pa.us> X-Pg-Spam-Score: -2.9 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Peter Eisentraut 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 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers