From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22803 invoked by alias); 30 May 2005 16:07:52 -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 1060 invoked by uid 22791); 30 May 2005 15:52:58 -0000 Received: from smtpout02-04.prod.mesa1.secureserver.net (HELO smtpout02-04.prod.mesa1.secureserver.net) (64.202.165.194) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Mon, 30 May 2005 15:52:58 +0000 Received: (qmail 23126 invoked from network); 30 May 2005 15:52:56 -0000 Received: from unknown (24.96.113.81) by smtpout02-04.prod.mesa1.secureserver.net (64.202.165.194) with ESMTP; 30 May 2005 15:52:56 -0000 Message-ID: <429B369F.3040507@coyotegulch.com> Date: Mon, 30 May 2005 17:31:00 -0000 From: Scott Robert Ladd User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050512) MIME-Version: 1.0 To: espie@nerim.net CC: Georg Bauhaus , Marc Espie , gcc@gcc.gnu.org Subject: Re: Sine and Cosine Accuracy References: <4295DE66.2050701@coyotegulch.com> <20050526154754.GA10785@redhat.com> <4295F374.6070901@coyotegulch.com> <17045.62613.557950.285394@gargle.gargle.HOWL> <20050529155740.D440412D1A@quatramaran.ens.fr> <429A10F4.3040704@futureapps.de> <20050529192354.GA21142@lain.home> In-Reply-To: <20050529192354.GA21142@lain.home> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2005-05/txt/msg01626.txt.bz2 Marc Espie wrote: > Heck, I can plot trajectories on a sphere that do not follow great circles, > and that extend over 360 degrees in longitude. I don't see why I should be > restricted from doing that. Can you show me a circumstance where sin(x - 2 * pi) and sin(x + 2 * pi) are not equal to sin(x)? Using an earlier example in these threads, do you deny that sin(pow(2.0,90.0)) == sin(5.15314063427653548) == sin(-1.130044672903051) -- assuming no use of -funsafe-math-optimizations, of course? Shall we mark all potentially troublesome optimizations as "unsafe", and chastise those who use them? Quite a few combinations of options can cause specific applications to fail, and other programs to work very well. Under such logic, we should replace -O3 with -Ounsafe, because some programs break when compiled with -O3. Since that's patently silly, perhaps we should be more concerned with making useful choices and improvements to GCC. > You can decide to restrict this stuff to plain old 2D geometry, and this would > be fine for teaching in elementary school, but this makes absolutely > no sense with respect to any kind of modern mathematics. The fact that trigonometric functions can extended beyond 2D geometry in no way invalidates their use in their original domain. I've written many 2D and 3D applications over the years without need for a sine outside the range [0, 2*PI] (or [-PI, PI] in some cases). Some people live and die by one of those programs, and no one's died yet because I used -ffast-math in compiling it. (I expect Gabriel dos Rios to respond with something pithy here; please don't disappoint me!) I keep saying that GCC can and should support the different needs of different applications. What is wrong with that? ..Scott