From patchwork Fri Apr 11 11:56:55 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Liebler X-Patchwork-Id: 338491 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 4353014008E for ; Fri, 11 Apr 2014 21:57:26 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=NoWfAw3buSkPIrsD6Z5Ss+znRWzyj og2vC8bOWyc40xJK8CPyvK7VD76akPbxzzgR4+GjxoTp1faqTLhfN6YtuS/6MkqE uXgIZIpklNMMUtG+eMmJK4TpoJq5Rx6haBOerg8pxWy5dGyZOFAJ650G9DgueY8N Pb5WlPMatlseS4= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:to:from:subject:date:message-id:mime-version :content-type; s=default; bh=7BehzK7Vb+b19wsH0pi0S/2Ix+Y=; b=UVF FEM42zIJsuSwYXb8Btes+8wora4/I9/4a3BhHvkNgf4yr8haKjdYSApjmXDAlW6J wkUl9KmcUVmuxUD5CB0+jjfEoZOc7/xWvByoHKh5K4N5Ofi1Lp5gj223YAY3d+0A DopCgNU+LsuhlHAA7CPh11oS7JMC7EpX2WJvIHF8= Received: (qmail 16249 invoked by alias); 11 Apr 2014 11:57:13 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 16165 invoked by uid 89); 11 Apr 2014 11:57:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: plane.gmane.org To: libc-alpha@sourceware.org From: Stefan Liebler Subject: [PATCH][BZ #16824] Fix failing y1 due to too large ulps in downward/upward rounding mode. Date: Fri, 11 Apr 2014 13:56:55 +0200 Lines: 50 Message-ID: Mime-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 Hi, on s390 the y1 tests for long double fails due to too large ulps in downward / upward rounding mode (See Bug 16824). According to Joseph Myers patch comment (https://sourceware.org/ml/libc-alpha/2014-03/msg00620.html), round-to-nearest is used internally to reduce error accumulation. Tests on s390/s390x shows following ulps: y1: 2 y1_downward: 4 y1_towardzero: 2 y1_upward: 5 Is this okay? On other architectures too? Bye --- 2014-04-11 Stefan Liebler [BZ #16824] * sysdeps/ieee754/ldbl-128/e_j1l.c (__ieee754_y1l): Set round-to-nearest internally to reduce error accumulation. --- diff --git a/sysdeps/ieee754/ldbl-128/e_j1l.c b/sysdeps/ieee754/ldbl-128/e_j1l.c index 70a1c86..db96c94 100644 --- a/sysdeps/ieee754/ldbl-128/e_j1l.c +++ b/sysdeps/ieee754/ldbl-128/e_j1l.c @@ -855,11 +855,14 @@ __ieee754_y1l (long double x) return -TWOOPI / x; if (xx <= 2.0L) { + int save_round = fegetround (); + libc_fesetround (FE_TONEAREST); /* 0 <= x <= 2 */ z = xx * xx; p = xx * neval (z, Y0_2N, NY0_2N) / deval (z, Y0_2D, NY0_2D); p = -TWOOPI / xx + p; p = TWOOPI * __ieee754_logl (x) * __ieee754_j1l (x) + p; + libc_fesetround (save_round); return p; }