From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5222 invoked by alias); 29 Apr 2013 13:21:17 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org Received: (qmail 5174 invoked by uid 89); 29 Apr 2013 13:21:16 -0000 X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,SPF_NEUTRAL autolearn=no version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from popelka.ms.mff.cuni.cz (HELO popelka.ms.mff.cuni.cz) (195.113.20.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Mon, 29 Apr 2013 13:20:57 +0000 Received: from domone.kolej.mff.cuni.cz (popelka.ms.mff.cuni.cz [195.113.20.131]) by popelka.ms.mff.cuni.cz (Postfix) with ESMTPS id 61B8F6A839; Mon, 29 Apr 2013 15:20:52 +0200 (CEST) Received: by domone.kolej.mff.cuni.cz (Postfix, from userid 1000) id EB40260470; Mon, 29 Apr 2013 15:06:31 +0200 (CEST) Date: Mon, 29 Apr 2013 13:21:00 -0000 From: =?utf-8?B?T25kxZllaiBCw61sa2E=?= To: wbrana at gmail dot com Cc: glibc-bugs@sourceware.org Subject: Re: [Bug math/14412] Removal of sysdeps/x86_64/fpu/s_sincos.S causes regressions Message-ID: <20130429130631.GA24033@domone.kolej.mff.cuni.cz> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-SW-Source: 2013-04/txt/msg00215.txt.bz2 On Mon, Apr 29, 2013 at 12:32:34PM +0000, wbrana at gmail dot com wrote: > http://sourceware.org/bugzilla/show_bug.cgi?id=14412 > > --- Comment #28 from wbrana at gmail dot com 2013-04-29 12:32:34 UTC --- > according to http://sourceware.org/bugzilla/show_bug.cgi?id=13658#c2 > fast functions can be used when source operand is in certain range. > Slow functions should be used only outside interval. > > "The FPTAN, FSIN, FCOS, and FSINCOS instructions set the C2 flag to 1 to > indicate that the source operand is beyond the allowable range of ±2^63 and > clear the C2 flag if the source operand is within the allowable range." > > So, outside the interval [-2^63,+2^63] ("allowable range"), these instructions > must not be used (or they can be used, but with a fallback if the C2 flag is > set to 1). But note that the glibc implementation is more accurate, even with > (very probably) correct rounding, so that it is better to use it anyway. > Well results of sin,cos.. with large numbers are pure garbage no matter what you try. As cos(1.0e18*PI) = cos(1.0e18*PI + PI) you can basicaly print random number between -1.0 and 1.0 and be correct.