commit | 8eab7b6886662a0b370eab5af96e8a26fa19f6df | [log] [tgz] |
---|---|---|
author | Rasmus Munk Larsen <rmlarsen@google.com> | Tue Dec 28 15:00:19 2021 +0000 |
committer | David Tellenbach <david.tellenbach@me.com> | Tue Dec 28 15:00:19 2021 +0000 |
tree | c118de03b8e9df57df094d4749ad32c7b0118599 | |
parent | 6e95c0cd9acd44dfad2f404e53b7b59083a35207 [diff] |
Improve exp<float>(): Don't flush denormal results +4% speedup. 1. Speed up exp(x) by reducing the polynomial approximant from degree 7 to degree 6. With exactly representable coefficients computed by the Sollya tool, this still gives a maximum relative error of 1 ulp, i.e. faithfully rounded, for arguments where exp(x) is a normalized float. This change results in a speedup of about 4% for AVX2. 2. Extend the range where exp(x) returns a non-zero result to from ~[-88;88] to ~[-104;88] i.e. return denormalized values for large negative arguments instead of zero. Compared to exp<double>(x) the denormalized results gradually decrease in accuracy down to 0.033 relative error for arguments around x = -104 where exp(x) is ~std::numeric<float>::denorm_min(). This is expected and acceptable.
Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.
For more information go to http://eigen.tuxfamily.org/.
For pull request, bug reports, and feature requests, go to https://gitlab.com/libeigen/eigen.