public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
To: paul zimmermann <Paul.Zimmermann@inria.fr>
Cc: 'GNU C Library' <libc-alpha@sourceware.org>,
	Joe Ramsay <Joe.Ramsay@arm.com>,
	Szabolcs Nagy <Szabolcs.Nagy@arm.com>
Subject: Re: [PATCH] aarch64: Improve SVE sin polynomial
Date: Thu, 3 Aug 2023 14:21:13 +0000	[thread overview]
Message-ID: <DB3PR08MB8986F4F6687C5F7E375712F18308A@DB3PR08MB8986.eurprd08.prod.outlook.com> (raw)

Hi Paul,

> you can still improve the polynomial with the following one generated by
> Sollya (https://www.sollya.org/) with relative error < 2^-52.454 on
> [-pi/2, pi/2], instead of 2^-51.765 for the one you propose:

So the goal is to reduce the ULP error. Due to the way floating point works,
errors are at their worst when the result is just above a power of 2. For the
wide sin(x) polynomial it happens when sin(x) is close to but larger than 0.5.
The poly is extremely accurate for small x. It's only problematic when x is large
and we cross an exponent boundary.

Szabolcs can explain it better but what we ended up doing is to scale the
sollya function so that errors at the end of the range are and reduced more.

Note also this is not the final polynomial. The ULP is a bit high at 3.3. I had a
more accurate one close to 2ULP but it could give results >1.0. So we need to
teach sollya to estimate the end from below, and not allow it to overshoot.

Cheers,
Wilco

             reply	other threads:[~2023-08-03 14:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03 14:21 Wilco Dijkstra [this message]
2023-08-03 15:22 ` Szabolcs Nagy
     [not found]   ` <p9u0msz79sga.fsf@coriandre.loria.fr>
2023-08-04  8:35     ` Szabolcs Nagy
2023-08-04 14:51     ` Vincent Lefevre
  -- strict thread matches above, loose matches on Subject: below --
2023-08-03 11:54 Joe Ramsay
2023-08-03 12:20 ` Paul Zimmermann
2023-10-03 10:48 ` Szabolcs Nagy

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=DB3PR08MB8986F4F6687C5F7E375712F18308A@DB3PR08MB8986.eurprd08.prod.outlook.com \
    --to=wilco.dijkstra@arm.com \
    --cc=Joe.Ramsay@arm.com \
    --cc=Paul.Zimmermann@inria.fr \
    --cc=Szabolcs.Nagy@arm.com \
    --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).