This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] Improves __ieee754_exp() performance by greater than 5x on sparc/x86.
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Patrick McGehearty <patrick dot mcgehearty at oracle dot com>
- Cc: <libc-alpha at sourceware dot org>
- Date: Thu, 14 Dec 2017 01:28:41 +0000
- Subject: Re: [PATCH] Improves __ieee754_exp() performance by greater than 5x on sparc/x86.
- Authentication-results: sourceware.org; auth=none
- References: <1512774211-43942-1-git-send-email-patrick.mcgehearty@oracle.com>
On Fri, 8 Dec 2017, Patrick McGehearty wrote:
> Revised constants t2, t3, t4, t5 to better match values of 1/n factorial.
To expand on the logic for such a change:
If the values were previously not 1/n! presumably they were coefficients
in some form of minimax approximation minimising the maximum error
(however measured) in the interval used in the original implementation.
The maximum error from just using 1/n! would be at the endpoints of the
interval (whereas a minimax approximation using an nth degree polynomial
would have equal maximum errors with alternating signs at n+2 points -
increasing some errors closer to 0 to decrease those at the endpoints).
You've changed the code to use a narrower interval. Thus, the original
minimax approximation is no longer optimal for the new interval, and it's
quite plausible that the maximum error from using 1/n! is smaller when you
restrict to the new interval.
This patch version is OK.
--
Joseph S. Myers
joseph@codesourcery.com