From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8697 invoked by alias); 31 May 2005 12:33:06 -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 8572 invoked by uid 22791); 31 May 2005 12:32:59 -0000 Received: from vinc17.net4.nerim.net (HELO ay.vinc17.org) (62.212.121.106) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 31 May 2005 12:32:59 +0000 Received: from lefevre by ay.vinc17.org with local (Exim 4.50) id 1Dd5vU-0006K9-C6; Tue, 31 May 2005 14:32:56 +0200 Date: Tue, 31 May 2005 13:34:00 -0000 From: Vincent Lefevre To: gcc@gcc.gnu.org Subject: Re: Sine and Cosine Accuracy Message-ID: <20050531123256.GR3541@ay.vinc17.org> Mail-Followup-To: gcc@gcc.gnu.org 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> <429B369F.3040507@coyotegulch.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <429B369F.3040507@coyotegulch.com> X-Mailer-Info: http://www.vinc17.org/mutt/ User-Agent: Mutt/1.5.9-vl-20050401i X-SW-Source: 2005-05/txt/msg01681.txt.bz2 On 2005-05-30 11:51:59 -0400, Scott Robert Ladd wrote: > 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 wonder if compilers could use information for assertions. For instance, instead of writing sin(x), you could write: sin((assert(x >= 0 && x <= 2 * pi), x)) possibly via a macro. IMHO, this would be better than using switches such as -ffast-math, and you could mix small ranges and large ranges in the same program. -- Vincent Lefèvre - Web: 100% accessible validated (X)HTML - Blog: Work: CR INRIA - computer arithmetic / SPACES project at LORIA