public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Joseph Myers <joseph@codesourcery.com>
To: Szabolcs Nagy <Szabolcs.Nagy@arm.com>
Cc: Anssi Hannula <anssi.hannula@bitwise.fi>,
	"libc-alpha@sourceware.org" <libc-alpha@sourceware.org>,
	nd <nd@arm.com>
Subject: Re: [PATCH 1/2] ieee754: Remove slow paths from asin and acos
Date: Tue, 24 Mar 2020 23:15:08 +0000	[thread overview]
Message-ID: <alpine.DEB.2.21.2003242314560.8310@digraph.polyomino.org.uk> (raw)
In-Reply-To: <714b667d-7345-bcd4-ca30-7ecbb7098bbc@arm.com>

On Mon, 27 Jan 2020, Szabolcs Nagy wrote:

> On 27/01/2020 10:45, Anssi Hannula wrote:
> > asin and acos have slow paths for rounding the last bit that cause some
> > calls to be 500-1500x slower than average calls.
> > 
> > These slow paths are rare, a test of a trillion (1.000.000.000.000)
> > random inputs between -1 and 1 showed 32870 slow calls for acos and 4473
> > for asin, with most occurrences between -1.0 .. -0.9 and 0.9 .. 1.0.
> > 
> > The slow paths claim correct rounding and use __sin32() and __cos32()
> > (which compare two result candidates and return the closest one) as the
> > final step, with the second result candidate (res1) having a small offset
> > applied from res. This suggests that res and res1 are intended to be 1
> > ULP apart (which makes sense for rounding), barring bugs, allowing us to
> > pick either one and still remain within 1 ULP of the exact result.
> > 
> > Remove the slow paths as the accuracy is better than 1 ULP even without
> > them, which is enough for glibc.
> > 
> > Also remove code comments claiming correctly rounded results.
> 
> the patch looks good to me.

Yes, please commit.

-- 
Joseph S. Myers
joseph@codesourcery.com

  parent reply	other threads:[~2020-03-24 23:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-27 10:45 Anssi Hannula
2020-01-27 11:25 ` [PATCH 2/2] ieee754: Remove unused __sin32 and __cos32 Anssi Hannula
2020-01-27 13:12 ` [PATCH 1/2] ieee754: Remove slow paths from asin and acos Szabolcs Nagy
2020-01-28 10:51   ` Anssi Hannula
2020-03-24 23:15   ` Joseph Myers [this message]
2020-12-18  7:09 ` [COMMITTED] " Siddhesh Poyarekar
2020-12-18  8:28   ` Paul Zimmermann
2020-12-18  9:26     ` 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=alpine.DEB.2.21.2003242314560.8310@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=Szabolcs.Nagy@arm.com \
    --cc=anssi.hannula@bitwise.fi \
    --cc=libc-alpha@sourceware.org \
    --cc=nd@arm.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).