This is the mail archive of the 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() performance by greater than 5x on sparc/x86.

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

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