From b7c83ca30ef8e85b6642151d95600a36535f8d97 Mon Sep 17 00:00:00 2001 From: Wilco Dijkstra Date: Wed, 7 Feb 2018 12:24:43 +0000 Subject: Remove slow paths from log Remove the slow paths from log. Like several other double precision math functions, log is exactly rounded. This is not required from math functions and causes major overheads as it requires multiple fallbacks using higher precision arithmetic if a result is close to 0.5ULP. Ridiculous slowdowns of up to 100000x have been reported when the highest precision path triggers. Interestingly removing the slow paths makes hardly any difference in practice: the worst case error is still ~0.502ULP, and exp(log(x)) shows identical results before/after on many millions of random cases. All GLIBC math tests pass on AArch64 and x64 with no change in ULP error. A simple test over a few hundred million values shows log is now 18% faster on average. * manual/probes.texi (slowlog): Delete documentation of removed probe. (slowlog_inexact): Likewise * sysdeps/ieee754/dbl-64/e_log.c (__ieee754_log): Remove slow paths. * sysdeps/ieee754/dbl-64/ulog.h: Remove unused declarations. --- manual/probes.texi | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'manual') diff --git a/manual/probes.texi b/manual/probes.texi index 8ab67562d7..e99b7f3cb4 100644 --- a/manual/probes.texi +++ b/manual/probes.texi @@ -288,23 +288,6 @@ input that results in multiple precision computation with precision and @code{$arg4} is the final accurate value. @end deftp -@deftp Probe slowlog (int @var{$arg1}, double @var{$arg2}, double @var{$arg3}) -This probe is triggered when the @code{log} function is called with an -input that results in multiple precision computation. Argument -@var{$arg1} is the precision with which the computation succeeded. -Argument @var{$arg2} is the input and @var{$arg3} is the computed -output. -@end deftp - -@deftp Probe slowlog_inexact (int @var{$arg1}, double @var{$arg2}, double @var{$arg3}) -This probe is triggered when the @code{log} function is called with an -input that results in multiple precision computation and none of the -multiple precision computations result in an accurate result. -Argument @var{$arg1} is the maximum precision with which computations -were performed. Argument @var{$arg2} is the input and @var{$arg3} is -the computed output. -@end deftp - @deftp Probe slowatan2 (int @var{$arg1}, double @var{$arg2}, double @var{$arg3}, double @var{$arg4}) This probe is triggered when the @code{atan2} function is called with an input that results in multiple precision computation. Argument -- cgit v1.2.3