public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Akila Welihinda <akilawelihinda@ucla.edu>
To: libc-alpha@sourceware.org
Cc: Akila Welihinda <akilawelihinda@ucla.edu>
Subject: [PATCH] sysdeps: Update Taylor Series formula in comment
Date: Sat, 11 Dec 2021 14:50:03 -0800	[thread overview]
Message-ID: <20211211225003.6772-1-akilawelihinda@ucla.edu> (raw)

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 <akilawelihinda@ucla.edu>
---
 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)


             reply	other threads:[~2021-12-11 22:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-11 22:50 Akila Welihinda [this message]
  -- strict thread matches above, loose matches on Subject: below --
2021-12-11 18:02 Akila Welihinda
2021-12-12  6:34 ` Paul Zimmermann
2021-12-12 16:50   ` Akila Welihinda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211211225003.6772-1-akilawelihinda@ucla.edu \
    --to=akilawelihinda@ucla.edu \
    --cc=libc-alpha@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).