aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/GlobalFunctions.h
diff options
context:
space:
mode:
authorGravatar Rasmus Munk Larsen <rmlarsen@google.com>2020-12-03 19:40:40 +0000
committerGravatar Rasmus Munk Larsen <rmlarsen@google.com>2020-12-03 19:40:40 +0000
commit25d8ae7465e6430bc2dc7f65800332932d3bb774 (patch)
treedaf4488df55322bc0840f2c75cb38f3884c4141c /Eigen/src/Core/GlobalFunctions.h
parenteb4d4ae07091dabfd5ae710ed5ca378d4e845bbd (diff)
Small cleanup of generic plog implementations:
Adding the term e*ln(2) is split into two step for no obvious reason. This dates back to the original Cephes code from which the algorithm is adapted. It appears that this was done in Cephes to prevent the compiler from reordering the addition of the 3 terms in the approximation log(1+x) ~= x - 0.5*x^2 + x^3*P(x)/Q(x) which must be added in reverse order since |x| < (sqrt(2)-1). This allows rewriting the code to just 2 pmadd and 1 padd instructions, which on a Skylake processor speeds up the code by 5-7%.
Diffstat (limited to 'Eigen/src/Core/GlobalFunctions.h')
0 files changed, 0 insertions, 0 deletions