News for hackers. Stuff that matters.
Re:Sin and Cos: The Programmer's Pals by stochastic_monk on Tuesday March 06, 2018 @11:26AM (#16529817)
I don't have advice on the specific `sin(x) / x`/`cos(x) / x^2`, but the Sleef vectorization library [0,1] supports operations with varying precision. (0.506, 1.0, and 3.5 ULP)

If you're working in a case where you can afford slightly lower accuracy, the 3.5ULP method can be a very significant speedup, especially since you're vectorizing at the same time. I got dozens of times in speedup when testing just the 1.0 ULP bound when performing sin/cos on a large vector. (I don't remember the precise number and should just re-run the tests.)

To generically dispatch this library, in case there's any interest, I wrapped it in some template metaprogramming in [2], so that the widest vectorization available is selected at compile-time when selecting a given operation.

[0]: http://sleef.org/

[1]: https://github.com/shibatch/sleef

[2]: https://github.com/dnbaker/vec

Re:Sin and Cos: The Programmer's Pals by vanderZwan on Tuesday March 06, 2018 @12:40PM (#16530392)
Thanks, forwarded your comment to a few colleagues who might have a use for it!