From: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: "Steve Ellcey" <sellcey@cavium.com>,
"Zack Weinberg" <zackw@panix.com>,
"Ondřej Bílka" <neleai@seznam.cz>,
"Siddhesh Poyarekar" <siddhesh@gotplt.org>,
"libc-alpha@sourceware.org" <libc-alpha@sourceware.org>,
nd <nd@arm.com>
Subject: Re: [PATCH 2/6] Remove slow paths from sin/cos
Date: Mon, 12 Mar 2018 21:13:00 -0000 [thread overview]
Message-ID: <DB6PR0801MB2053FFC3A6ACD26708F400F483D30@DB6PR0801MB2053.eurprd08.prod.outlook.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1803121607030.18746@digraph.polyomino.org.uk>
Joseph Myers wrote:
> On Mon, 12 Mar 2018, Wilco Dijkstra wrote:
>
>> Though these patches keep the ULP accuracy across the full range as is,
>> we could agree on higher ULP errors for large/huge range reduction cases
>> in the future. The main complexity is for certain rare inputs which happen to
>> be extremely close to an integer multiple of PI/2, and those few cases mean
>> you need significant extra work to guarantee 0.5 ULP error bound on range
>> reduction.
>
> I don't think the work for having an error bound not much more than 0.5ulp
> on the final result of sin/cos for large arguments is significantly
> different from the work for having an error bound of say 3ulp (the
> testsuite has a global maximum of 9ulp (16ulp for IBM long double) beyond
> which it will not accept errors even if those large errors are listed in
> libm-test-ulps files - that bound is simply based on the errors
> empirically observed at present, for functions other than Bessel functions
> and cpow which are known to have cases with much larger errors).
Having to do another reduction step can increase latency significantly. To give
an example, I had to increase accuracy of the first-level range reduction because
a handful huge multiples of PI (6-7 digits) had 2-3ULP reduction error. The additional
accuracy means range reduction became 50% slower while being way too accurate
for almost all inputs.
Obviously it would be possible redesign it from scratch using a much smaller input
range and FMA when available etc.
Wilco
next prev parent reply other threads:[~2018-03-12 21:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-09 15:46 Wilco Dijkstra
2018-03-09 16:17 ` Siddhesh Poyarekar
2018-03-09 18:19 ` Ondřej Bílka
2018-03-09 18:52 ` Zack Weinberg
2018-03-09 23:05 ` Steve Ellcey
2018-03-10 0:52 ` Joseph Myers
2018-03-12 15:36 ` Wilco Dijkstra
2018-03-12 15:46 ` Zack Weinberg
2018-03-12 16:10 ` Joseph Myers
2018-03-12 21:13 ` Wilco Dijkstra [this message]
2018-03-09 19:06 ` Wilco Dijkstra
2018-03-09 19:31 ` Siddhesh Poyarekar
2018-03-12 18:09 ` Wilco Dijkstra
2018-03-13 8:53 ` Siddhesh Poyarekar
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=DB6PR0801MB2053FFC3A6ACD26708F400F483D30@DB6PR0801MB2053.eurprd08.prod.outlook.com \
--to=wilco.dijkstra@arm.com \
--cc=joseph@codesourcery.com \
--cc=libc-alpha@sourceware.org \
--cc=nd@arm.com \
--cc=neleai@seznam.cz \
--cc=sellcey@cavium.com \
--cc=siddhesh@gotplt.org \
--cc=zackw@panix.com \
/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).