Today I'm trying to figure out how the C Std library implements e^x (exp, expf functions in math.h) No luck so far, still digging
Corner cases & floating point exception flags make vectorization hard, but if you strip handling of that stuff out, an inlinable version of the code should vectorize.
-
-
exp( ) is very friendly to vectorization. You can get sub-ulp accuracy and all corner cases correct for a whole vector in ~16 instructions on AVX-512, more like 25-30 on AVX2 or arm64 NEON.
-
No one cares about flags in vector contexts, but that includes getting them right too.
-
I don’t know of good open-source implementations, but Intel has them in MKL, Apple has them in Accelerate, some other vendors also provide them.
-
I remember Sony had them in their PS3 devkit. And, iirc, they open sourced that.
-
Found a couple: https://github.com/erwincoumans/sce_vectormath … (include/vectormath/SSE/cpp/vectormath_aos.h) and https://github.com/glampert/vectormath … (sse/vectormath.hpp)
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.