From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2520 invoked by alias); 27 May 2005 20:55:19 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 2457 invoked by uid 22791); 27 May 2005 20:55:12 -0000 Received: from amdext4.amd.com (HELO amdext4.amd.com) (163.181.251.6) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Fri, 27 May 2005 20:55:12 +0000 Received: from SAUSGW01.amd.com (sausgw01.amd.com [163.181.250.21]) by amdext4.amd.com (8.12.11/8.12.11/AMD) with ESMTP id j4RKnDKf013721; Fri, 27 May 2005 15:55:10 -0500 Received: from 163.181.250.1 by SAUSGW01.amd.com with ESMTP (AMD SMTP Relay (Email Firewall v6.1.0)); Fri, 27 May 2005 15:55:03 -0500 X-Server-Uuid: 8C3DB987-180B-4465-9446-45C15473FD3E Received: from sausexmb1.amd.com (SAUSEXMB1.amd.com [163.181.3.156]) by amdint2.amd.com (8.12.8/8.12.8/AMD) with ESMTP id j4RKt2c7009558; Fri, 27 May 2005 15:55:02 -0500 (CDT) Content-class: urn:content-classes:message MIME-Version: 1.0 Subject: RE: Sine and Cosine Accuracy Date: Sat, 28 May 2005 04:32:00 -0000 Message-ID: <84EA05E2CA77634C82730353CBE3A843028F468D@SAUSEXMB1.amd.com> From: "Menezes, Evandro" To: "Scott Robert Ladd" cc: gcc@gcc.gnu.org X-WSS-ID: 6E8956AD2UO2738940-01-01 Content-Type: multipart/mixed; boundary="----_=_NextPart_001_01C562FE.5A4321C9" X-SW-Source: 2005-05/txt/msg01522.txt.bz2 This is a multi-part message in MIME format. ------_=_NextPart_001_01C562FE.5A4321C9 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 2362 Scott,=20 > Actually, it tested every 1.8=B0, but who wants to be picky.=20 > I've rerun the test overnight at greater resolution, testing every > 0.00000018 degress, and saw no change in the result. That's because the error is the same but symmetrical for sin and cos, so th= at, when you calculate the sum of their squares, one cancels the other out. The lack of accuracy in x87 is well known: see http://www.gnu.org/software/= libc/manual/html_node/Errors-in-Math-Functions.html#Errors-in-Math-Function= s. I modified your test slightly to return the number of error bits. My resul= ts using GCC 4.0.0 on an Opteron system running SUSE 9.1 were: x87sincos-32-fst cumulative error: 4 (ulp) -5.10702591327572e-15 (decimal) x87sincos-32-sse cumulative error: 4 (ulp) -5.10702591327572e-15 (decimal) x87sincos-32-x87 cumulative error: 2 (ulp) -1.4432899320127e-15 (decimal) x87sincos-64-sse cumulative error: 4 (ulp) -4.77395900588817e-15 (decimal) x87sincos-64-x87 cumulative error: 2 (ulp) -1.22124532708767e-15 (decimal) On an Athlon MP system running SUSE 9.1: x87sincos-32-fst cumulative error: 4 (ulp) -5.10702591327572e-15 (decimal) x87sincos-32-x87 cumulative error: 2 (ulp) -1.4432899320127e-15 (decimal) Now, adding -funsafe-math-optimizations, on the same systems: x87sincos-32-fst cumulative error: 4 (ulp) -5.10702591327572e-15 (decimal) x87sincos-32-sse cumulative error: 4 (ulp) -5.10702591327572e-15 (decimal) x87sincos-32-x87 cumulative error: 0 (ulp) +0 (decimal) x87sincos-64-sse cumulative error: 4 (ulp) -4.77395900588817e-15 (decimal) x87sincos-64-x87 cumulative error: 0 (ulp) +0 (decimal) And: x87sincos-32-fst cumulative error: 4 (ulp) -5.10702591327572e-15 (decimal) x87sincos-32-x87 cumulative error: 0 (ulp) +0 (decimal) Any perceived increase in accuracy in this test comes from intermediary cal= culations being done with 80 bits and because the errors in fsin are comple= mentary to those in fcos. HTH --=20 _______________________________________________________ Evandro Menezes AMD Austin, TX ------_=_NextPart_001_01C562FE.5A4321C9 Content-Type: application/octet-stream; name=unsafe.tar.bz2 Content-Transfer-Encoding: base64 Content-Description: unsafe.tar.bz2 Content-Disposition: attachment; filename=unsafe.tar.bz2 Content-length: 1664 QlpoOTFBWSZTWS7IOboAAzd/gs32BAB+f//f/+fPb//v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