From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 65253 invoked by alias); 28 Sep 2016 20:04:25 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 65238 invoked by uid 89); 28 Sep 2016 20:04:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM autolearn=no version=3.3.2 spammy=Hx-languages-length:636, 0x3feb6000, do_sin, 1.096 X-HELO: mail-it0-f48.google.com X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding; bh=/pVEmFPvTe+8oL5+in9aRxhTPwxy1WfItS0cPrUnJoc=; b=cI/WQaVwzCxNYuSpLlaivH7a5khd2Za7w4addhQUnsmAOybQYp45K58NuH+zaJO2Ls tRCSmYfT7FqYEMy/ePBnzhGahpt3K2uwptSDEn85g4UrWvXLseAFEULCl/tFX+DKLmuE OU1WATh4c7x1HnhyG7UtKm0rL6ZG644ldF9XTtNsM7GQwI7M3d1htllz1ykwneDO+YWR GXpe00OOma0BjMG7MDxbb/DjhMLzfqTr9Z3ptpOD9NwTdP6NWFMOHYpCZQJrOuIsHJQ5 469HzLQLwJmHlyHJLTT3NayqSqN2zZcxTt2gNZZH3+8f9kcCQZWyOMhmEs/nFcW3LG8O ztMw== X-Gm-Message-State: AA6/9RkuRy/44LHgkq3ryqQX909DRt6SdczcuD9fWMdxt/mlcp7SRPFCuzQVBsrVin1OFgFd X-Received: by 10.36.219.138 with SMTP id c132mr4344575itg.16.1475093061598; Wed, 28 Sep 2016 13:04:21 -0700 (PDT) Subject: Re: [PATCH 4/4] Use copysign instead of ternary for some sin/cos input ranges To: Manfred , libc-alpha@sourceware.org References: <1474998553-2366-1-git-send-email-siddhesh@sourceware.org> <1474998553-2366-5-git-send-email-siddhesh@sourceware.org> <343e148d-c0ce-c506-a040-a80301856af4@gmail.com> From: Carlos O'Donell Message-ID: Date: Wed, 28 Sep 2016 20:04:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <343e148d-c0ce-c506-a040-a80301856af4@gmail.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2016-09/txt/msg00567.txt.bz2 On 09/28/2016 08:59 AM, Manfred wrote: > > > On 9/27/2016 7:49 PM, Siddhesh Poyarekar wrote: >> @@ -479,7 +479,7 @@ __sin (double x) >> { >> res = do_sin (x, 0, &cor); >> retval = (res == res + 1.096 * cor) ? res : slow1 (x); >> - retval = m > 0 ? retval : -retval; >> + retval = __copysign (retval, x); >> } /* else if (k < 0x3feb6000) */ >> > The ternary uses m, __copysign uses x. It could be correct (I didn't check the full context), but just in case... In both those cases X < pi, and therefore the result has the same sign as X. -- Cheers, Carlos.