From patchwork Sun Aug 22 21:17:00 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Kargl X-Patchwork-Id: 62394 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]) by ozlabs.org (Postfix) with SMTP id 60D3BB70D4 for ; Mon, 23 Aug 2010 07:17:11 +1000 (EST) Received: (qmail 1662 invoked by alias); 22 Aug 2010 21:17:08 -0000 Received: (qmail 1644 invoked by uid 22791); 22 Aug 2010 21:17:07 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from troutmask.apl.washington.edu (HELO troutmask.apl.washington.edu) (128.208.78.105) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 22 Aug 2010 21:17:02 +0000 Received: from troutmask.apl.washington.edu (localhost.apl.washington.edu [127.0.0.1]) by troutmask.apl.washington.edu (8.14.4/8.14.4) with ESMTP id o7MLH0HP068838; Sun, 22 Aug 2010 14:17:00 -0700 (PDT) (envelope-from sgk@troutmask.apl.washington.edu) Received: (from sgk@localhost) by troutmask.apl.washington.edu (8.14.4/8.14.4/Submit) id o7MLH0Kn068837; Sun, 22 Aug 2010 14:17:00 -0700 (PDT) (envelope-from sgk) Date: Sun, 22 Aug 2010 14:17:00 -0700 From: Steve Kargl To: Tobias Burnus Cc: gcc patches , gfortran Subject: Re: [Patch, Fortran, committed] PR 45367/36158 - Increase numeric tolerance in bessel_{6, 7}.f90 Message-ID: <20100822211700.GA68815@troutmask.apl.washington.edu> References: <4C70F41C.8050801@net-b.de> <4C712EF2.4020404@net-b.de> Mime-Version: 1.0 Content-Disposition: inline In-Reply-To: <4C712EF2.4020404@net-b.de> User-Agent: Mutt/1.4.2.3i 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 On Sun, Aug 22, 2010 at 04:06:42PM +0200, Tobias Burnus wrote: > Tobias Burnus wrote: > >I increased now the tolerance based on Dominique's values and cross > >checked using -m32 on x86-64-linux. I hope it will now work on most > >systems > > Dominique found additional failures for bessel_6.f90. Let's see how many > systems still fail with the numbers below. I have still the hope that > there are reasonable numbers which work on all systems with working > jn/yn functions ... > One needs the bessel_7.f90 diff to get it to pass on i686-*-freebsd. The simplify.c diff is a cleanup patch. Index: testsuite/gfortran.dg/bessel_7.f90 =================================================================== --- testsuite/gfortran.dg/bessel_7.f90 (revision 163461) +++ testsuite/gfortran.dg/bessel_7.f90 (working copy) @@ -8,7 +8,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, 3, 5, 7, 2, 12, 4, 7, 3, 30, 168 ] + * [2, 3, 3, 5, 7, 2, 12, 4, 7, 6, 30, 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 ] @@ -19,7 +19,7 @@ real :: rec(0:Nmax), lib(0:Nmax) integer :: i do i = 1, ubound(values,dim=1) - call compare(values(i), myeps(i), nit(i), 3*epsilon(0.0)) + call compare(values(i), myeps(i), nit(i), 6*epsilon(0.0)) end do contains Index: fortran/simplify.c =================================================================== --- fortran/simplify.c (revision 163461) +++ fortran/simplify.c (working copy) @@ -1237,7 +1237,7 @@ gfc_simplify_bessel_n2 (gfc_expr *order1 if (jn && n1 == 0) { e = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); - mpfr_set_ui (e->value.real, 1.0, GFC_RND_MODE); + mpfr_set_ui (e->value.real, 1, GFC_RND_MODE); gfc_constructor_append_expr (&result->value.constructor, e, &x->where); n1++; @@ -1247,7 +1247,7 @@ gfc_simplify_bessel_n2 (gfc_expr *order1 { e = gfc_get_constant_expr (x->ts.type, x->ts.kind, &x->where); if (jn) - mpfr_set_ui (e->value.real, 0.0, GFC_RND_MODE); + mpfr_set_ui (e->value.real, 0, GFC_RND_MODE); else mpfr_set_inf (e->value.real, -1); gfc_constructor_append_expr (&result->value.constructor, e, @@ -1311,7 +1311,7 @@ gfc_simplify_bessel_n2 (gfc_expr *order1 return &gfc_bad_expr; } if (jn) - gfc_constructor_insert_expr (&result->value.constructor, e, &x->where, -2); + gfc_constructor_insert_expr (&result->value.constructor, e, &x->where, -2); else gfc_constructor_append_expr (&result->value.constructor, e, &x->where);