public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: Patrick McGehearty <patrick.mcgehearty@oracle.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] Improves __ieee754_exp(x) performance by 18-37% when |x| < 1.0397
Date: Thu, 29 Mar 2018 10:38:00 -0000	[thread overview]
Message-ID: <20180329103818.GD4418@port70.net> (raw)
In-Reply-To: <1521586916-49507-1-git-send-email-patrick.mcgehearty@oracle.com>

* Patrick McGehearty <patrick.mcgehearty@oracle.com> [2018-03-20 19:01:56 -0400]:
> Adds a fast path to e_exp.c when |x| < 1.03972053527832.
> When values are tested in isolation, reduction in execution
> time is: aarch 30%, sparc 18%, x86 37%.
> When comparing benchtests/bench.out which includes values
> outside that range, the gains are:
> aarch 8%, sparc 5%, x86 9%.
> 
> make check is clean (no increase in ulp for any math test).
> Testing 20M values for each rounding mode in that range shows
> approximately one in 200 values is off by 1 ulp. No value tested
> for exp(x) changed by 2 or more ulp.
> 
> No observed change in performance or accuracy for x outside
> fast path range.
> 
> These changes will be active for all platforms that don't provide
> their own exp() routines. They will also be active for ieee754
> versions of ccos, ccosh, cosh, csin, csinh, sinh, exp10, gamma, and
> erf.
> 
> ChangeLog:
> 2018-03-20  Patrick McGehearty <patrick.mcgehearty@oracle.com>
> 
>         * sysdeps/ieee754/dbl-64/e_exp.c: faster __ieee754_exp()
>         * sysdeps/ieee754/dbl-64/eexp.tbl: New file for e_exp.c

i think this is ok,
further improvements can be done separately.
i don't yet know when i will be able to post my version.

i'd mention that it increases rodata size by about 2k.

(i think the worst case ulp error is < 0.513 somewhere
around 0.5078 or -0.836 which is acceptable)

> @@ -74,7 +112,7 @@ __ieee754_exp (double x)
>  	y = t + three33.x;
>  	base = y - three33.x;	/* t rounded to a multiple of 2**-18      */
>  	junk2.x = y;
> -	del = (t - base) - eps;	/*  x = bexp*ln(2) + base + del           */
> +	del = (t - base) - eps;	/*  x = bexp*ln(2) + base + del	          */

this is a spurious whitespace change.

      reply	other threads:[~2018-03-29 10:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-20 23:02 Patrick McGehearty
2018-03-29 10:38 ` Szabolcs Nagy [this message]

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=20180329103818.GD4418@port70.net \
    --to=nsz@port70.net \
    --cc=libc-alpha@sourceware.org \
    --cc=patrick.mcgehearty@oracle.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).