From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25932 invoked by alias); 26 May 2011 17:59:40 -0000 Received: (qmail 25923 invoked by uid 22791); 26 May 2011 17:59:40 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 May 2011 17:59:26 +0000 Received: (qmail 30736 invoked from network); 26 May 2011 17:59:25 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 26 May 2011 17:59:25 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1QPeqB-0001E4-BU; Thu, 26 May 2011 17:59:23 +0000 Date: Thu, 26 May 2011 18:41:00 -0000 From: "Joseph S. Myers" To: "William J. Schmidt" cc: Richard Guenther , gcc-patches@gcc.gnu.org Subject: Re: [PATCH] More pow(x,c) expansions in cse_sincos pass (PR46728, patch 3) In-Reply-To: <1306432259.4821.73.camel@L3G5336.ibm.com> Message-ID: References: <1306345412.4821.56.camel@L3G5336.ibm.com> <1306432259.4821.73.camel@L3G5336.ibm.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg02085.txt.bz2 On Thu, 26 May 2011, William J. Schmidt wrote: > + /* Optimize pow(x,1./3.) = cbrt(x). This is always safe. */ No, it's not always safe. 1./3. isn't exactly representable; if x is negative (and finite), the correct value of the LHS is a NaN (with the "invalid" exception raised) because the value of 1./3. actually has an even denominator, whereas the correct value of the RHS is a negative real value. -- Joseph S. Myers joseph@codesourcery.com