On Wednesday, 2 January 2019 at 09:35:39 UTC, kinke wrote:
On Tuesday, 1 January 2019 at 23:36:55 UTC, Guillaume Piolat
wrote:
llvm_exp (defers to C runtime) gives considerable speed
improvement over `std.math.exp`.
My tests back then on Linux also showed new `exp(float)` being
about half as fast as C, while the double-version was somehow
4x faster.
Interesting. At least the VS runtime seems to have different code
for `exp(float)` and `exp(double)`. This could be an explanation.
Then look at the implementation of exp() and you'll see that it
uses ldexp() once. So by porting Ilya's version (or the Cephes
one) to Phobos, I'm sure we can match the C speed for
single-precision too.
Good idea.