4 ms·
Here's a solution which is vectorizable: http://gallium.inria.fr/blog/fast-vectorizable-math-approx/ http://gallium.inria.fr/blog/fast-vectorizable-math-approx/
by xioxox 5y ago
Here's a solution which is vectorizable: http://gallium.inria.fr/blog/fast-vectorizable-math-approx/ http://gallium.inria.fr/blog/fast-vectorizable-math-approx/
I've also read that Chebyshev polynomials are far better for approximating functions than Taylor series (eg https://en.wikipedia.org/wiki/Approximation_theory https://en.wikipedia.org/wiki/Approximation_theory)
- freemint 5y agoThis matters less once you put things through the horner scheme. And if you are not you are leaving performance on the table.
- arthur2e5 5y agoHorner does not conflict with vectorization in this case. If you read the code, it actually uses Horner — the vectorizability applies to when you call the online function in a loop.