From patchwork Wed Apr 23 13:20:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tejas Belagod X-Patchwork-Id: 341857 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 5C4F3140127 for ; Wed, 23 Apr 2014 23:20:20 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=jKVMU/x0FJMev4gaFRja2UNJ/1AruYAolooNwkOL8sqcf+ uuanqi/ekEZ/4/KhXiYG0vlI0Y+zuAMIoUcfTVweUl1ZGjn4mxoUFuivcXLMGrTb FsLAkppJkdOe26B0/YPO1YtA822RyfyN5OsMQxXxH1sA5aMNdkpyez6J83qL0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=bf2pqvarWNNsmYSJtft/VtGOWfE=; b=ohvJuz9urVcQ+Atva8zM eLkE88ijFwljvjlWECsC86RhGvYCLjGoc/joyipProrSnTE+GAxlczeU9RTNHBp2 FRFLM2E8y0XXDu1EhTABTvyvnKyrHaGfpsg7XWQykDdBj5C25clELxyyoVPle9xp 2msBYXpGO05u6I6nKeQV4j0= Received: (qmail 25035 invoked by alias); 23 Apr 2014 13:20:13 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 25025 invoked by uid 89); 23 Apr 2014 13:20:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: service87.mimecast.com Received: from service87.mimecast.com (HELO service87.mimecast.com) (91.220.42.44) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 23 Apr 2014 13:20:09 +0000 Received: from cam-owa1.Emea.Arm.com (fw-tnat.cambridge.arm.com [217.140.96.21]) by service87.mimecast.com; Wed, 23 Apr 2014 14:20:07 +0100 Received: from [10.1.203.80] ([10.1.255.212]) by cam-owa1.Emea.Arm.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 23 Apr 2014 14:20:21 +0100 Message-ID: <5357BE05.2080701@arm.com> Date: Wed, 23 Apr 2014 14:20:05 +0100 From: Tejas Belagod User-Agent: Thunderbird 2.0.0.18 (X11/20081120) MIME-Version: 1.0 To: "gcc-patches@gcc.gnu.org" Subject: [Patch, Fortran, testsuite] Increase tolerance level for precision of bessel function. X-MC-Unique: 114042314200703801 X-IsSubscribed: yes Hi, The attached patch adjusts a fortran test to decrease the precision of one of the points on the bessel curve. gfortran.dg/bessel_7.f90 fails for a value 3.0 because libm does not seem to be accurate enough compared to what the test expects. I did a like-for-like run on x86 vs aarch64. The issue seems to be in the level of precision that this test checks for. At the fail point, though the two values being compared are comparable, they aren't equal. On aarch64, it looks like this: 33 -0.138861489E+30 -0.138861319E+30 -0.17E+24 10.2699956894 T T 34 -0.304842886E+31 -0.304842493E+31 -0.39E+25 10.8117713928 T T 35 -0.689588648E+32 -0.689587681E+32 -0.97E+26 11.7649326324 T T 36 -0.160599184E+34 -0.160598952E+34 -0.23E+28 12.1240425110 T F If you see row #36, the 2nd and 3rd column values are comparable, but not equal. The delta is indicated in the 5th column which is greater that what the test expects - 12 ULPs. On x86 it looks like this: 33 -0.138861508E+30 -0.138861366E+30 -0.14E+24 8.5583286285 T T 34 -0.304842916E+31 -0.304842614E+31 -0.30E+25 8.3167467117 T T 35 -0.689588696E+32 -0.689587971E+32 -0.73E+26 8.8236989975 T T 36 -0.160599184E+34 -0.160599029E+34 -0.15E+28 8.0826950073 T T The delta on aarch64 is more than x86. If we increase the tolerance level for precision as shown in the patch, the test works fine for both x86 and aarch64. Tested on aarch64-none-linux-gnu, x86_64-unknown-linux-gnu. OK for trunk? Thanks, Tejas. Changelog: 2014-04-23 Tejas Belagod testsuite/ * gfortran.dg/bessel_7.f90(myeps): Increase precision tolerance level. diff --git a/gcc/testsuite/gfortran.dg/bessel_7.f90 b/gcc/testsuite/gfortran.dg/bessel_7.f90 index 7e63ed1..c6b5f74 100644 --- a/gcc/testsuite/gfortran.dg/bessel_7.f90 +++ b/gcc/testsuite/gfortran.dg/bessel_7.f90 @@ -16,7 +16,7 @@ implicit none real,parameter :: values(*) = [0.0, 0.5, 1.0, 0.9, 1.8,2.0,3.0,4.0,4.25,8.0,34.53, 475.78] real,parameter :: myeps(size(values)) = epsilon(0.0) & - * [2, 3, 4, 5, 8, 2, 12, 6, 7, 6, 36, 168 ] + * [2, 3, 4, 5, 8, 2, 13, 6, 7, 6, 36, 168 ] ! The following is sufficient for me - the values above are a bit ! more tolerant ! * [0, 0, 0, 3, 3, 0, 9, 0, 2, 1, 22, 130 ]