This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Improves __ieee754_exp(x) performance by 18-37% when |x| < 1.0397


* 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]