-
- Downloads
avoid cancellation when x is near 1, and use algorithm from pow.[ch]
This follows a comment from Guillaume Melquiond: for x near 1, the argument reduction r*x-1 used a value of r different from 1, which produces some cancellation, and we could only bound the *absolute* error, and as a result for x near 1 the fast path did fail often. For example, if we change the range of random values for log (file src/generic/log/random_under_test.h) to [511/512,513/512], the reciprocal throughput given by ./perf.sh log on a i7-8700 jumps to 70 cycles. With the new code, which bounds the *relative* error, the reciprocal throughput is about 22 cycles on a i7-8700, whatever the range of random values.
Please register or sign in to comment