From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sourceware.org (Postfix) with ESMTPS id 65240385840C for ; Sun, 12 Dec 2021 06:34:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 65240385840C Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=inria.fr Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:message-id:from:to:cc:in-reply-to:subject: references; bh=DF05HnsHUdwneOKnatH7kI3FXdGup9f32qSACBNnaqs=; b=EArsKoklS7kkIYjLWWs9EQM8XSL+84jz/L0LOIkRqxECTZ8D6x4MBjif HiLyhToObVx46si0dd6lxGt87f1YBUeTcDGNYEJZP53wFp/4P/O+MQq3k dqpUpzGzkhykMis4Wc+pPn6Dpvm34sYpbkRs5rYZnO+0d3Y/sZFibr67d s=; IronPort-HdrOrdr: =?us-ascii?q?A9a23=3AMk9ToaHWyqsxLzLWpLqE18eALOsnbusQ8zAX?= =?us-ascii?q?PiFKIiC9F/bzqynApoV+6faZslcssQgb6LW90cq7MBThHPxOkOss1N6ZNWHbUQ?= =?us-ascii?q?CTXeJfBOXZowEIzxeQysdtkY1kc6R4FbTLYWSS9fyW3CCIV+kl3dHvys6Vuds?= =?us-ascii?q?=3D?= X-IronPort-AV: E=Sophos;i="5.84,326,1620684000"; d="scan'208";a="400459128" Received: from tomate.loria.fr (HELO tomate) ([152.81.10.51]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Dec 2021 07:34:57 +0100 Date: Sun, 12 Dec 2021 07:34:57 +0100 Message-Id: From: Paul Zimmermann To: Akila Welihinda Cc: libc-alpha@sourceware.org, akilawelihinda@ucla.edu In-Reply-To: <20211211180214.5692-1-akilawelihinda@ucla.edu> (message from Akila Welihinda on Sat, 11 Dec 2021 10:02:14 -0800) Subject: Re: [PATCH] sysdeps: Update Taylor Series formula in comment References: <20211211180214.5692-1-akilawelihinda@ucla.edu> X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 12 Dec 2021 06:35:02 -0000 Dear Akila, this change looks good to me. To make the code clearer, what do you think of changing 'a' into 'x' in the macro TAYLOR_SIN (and 'da' to 'dx')? Paul Zimmermann > From: Akila Welihinda > Date: Sat, 11 Dec 2021 10:02:14 -0800 > Cc: Akila Welihinda > > The macro TAYLOR_SIN adds the term `-0.5*da*a^2 + da` in hopes > of regaining some precision as a function of da. However the > comment says we add the term `-0.5*da*a^2 + 0.5*da` which is > different. This fix just updates the comment to reflect the > code. > > Signed-off-by: Akila Welihinda > --- > sysdeps/ieee754/dbl-64/s_sin.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c > index 7d89e3dfc2..31e08e3a70 100644 > --- a/sysdeps/ieee754/dbl-64/s_sin.c > +++ b/sysdeps/ieee754/dbl-64/s_sin.c > @@ -53,7 +53,7 @@ > /* The computed polynomial is a variation of the Taylor series expansion for > sin(a): > > - a - a^3/3! + a^5/5! - a^7/7! + a^9/9! + (1 - a^2) * da / 2 > + a - a^3/3! + a^5/5! - a^7/7! + a^9/9! - da*a^2/2 + da > > The constants s1, s2, s3, etc. are pre-computed values of 1/3!, 1/5! and so > on. The result is returned to LHS. */ > -- > 2.30.1 (Apple Git-130)