Open invexed opened 7 years ago
Hi,
There are plans to add both precise and approximate versions of various mathematical functions. The list of functions is at least what C++ provides in the cmath
header, initially the C++98 subset, later C++11.
The reason why this hasn't been done already is lack of time. The projects that use libsimdpp and where I'm involved myself don't use most of these functions. The implementations of functions that are used are not rigorously tested and it's probably not a good idea to open source things that are possibly broken in some edge case :-)
Any contributions in this area are welcome. One possibility to reduce the effort needed is to port the code that boost.simd uses (at least used to use, before the recent purge of history), as the licenses are the same.
Forgot to mention that there's several more people interested in math functions, though I don't know how much time they will be able contribute. To anyone who starts working on this feature, please create an issue for functions that you are working on, assign to yourself and don't close the issue until the implementation lands into the master branch.
Thanks for the quick reply.
Unfortunately I haven't got the time at the moment to attempt the implementation of further math functions, but I will have a go if/when I'm less busy.
Shall I leave this issue open for the time being?
Yes, let's leave this issue open.
In older projects we used Intel's amath for exp2(), sin(), cos(), and possibly some other similar functions. It would be nice to these in simdpp!
I am currently porting boost.simd math functions to libsimdpp. I will come up with some initial pull requests in the near future.
@xugng That's great to hear. Could you do a preliminary PR as early as possible so that we can discuss changes? Even a single function would be enough at the beginning.
The license for Gromacs (LGPL >= 2.1) prevents it from being included in libsimdpp but it contains some highly optimized SIMD code for mathematical functions. I haven't used it myself but I guess it might be useful outside the scope of libsimdpp. I just wanted to mention it because the Gromacs SIMD implementation of mathematical functions might not be so well-known.
https://github.com/gromacs/gromacs/blob/master/src/gromacs/simd/simd_math.h http://manual.gromacs.org/documentation/2016.4/doxygen/html-lib/simd__math_8h.xhtml https://stackoverflow.com/a/47951585/757777
Hi,
Are there any immediate plans to implement more math functions, such as
log()
andexp()
? If not, is there a reason as to why they haven't been implemented?Thanks.