From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 75455 invoked by alias); 29 Mar 2018 10:38:24 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 75417 invoked by uid 89); 29 Mar 2018 10:38:23 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,KAM_NUMSUBJECT,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=accuracy, patrick, erf, increases X-HELO: port70.net Date: Thu, 29 Mar 2018 10:38:00 -0000 From: Szabolcs Nagy To: Patrick McGehearty Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] Improves __ieee754_exp(x) performance by 18-37% when |x| < 1.0397 Message-ID: <20180329103818.GD4418@port70.net> References: <1521586916-49507-1-git-send-email-patrick.mcgehearty@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1521586916-49507-1-git-send-email-patrick.mcgehearty@oracle.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-SW-Source: 2018-03/txt/msg00593.txt.bz2 * Patrick McGehearty [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 > > * 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.