A c++-20 template based short vector library with faithfully rounded elementary functions.
Cftal is a c++-20 template based short vector library with specializations using intrinsic functions. Part of the library are vectorized elementary and some special functions (erf, erfc, tgamma, lgamma, j0, y0, j1 and y1) in double, single and half precision. The elementary functions should be faithfully rounded.
Specializations for x86 processors with instructions set extensions up to AVX2 are implemented and tested. The specializations for processors with AVX512 extensions are not tested yet. AArch64 code is not tested.
- the reproduction of the used constants in the code requires sollya (https://www.sollya.org), libsollya-dev to build extensions to sollya and the maxima (https://maxima.sourceforge.io) computer algebra system
- the test code uses mpfr (https://www.mpfr.org) and requires libmpfr-dev to compile the programs testing the precision (and speed) of the vectorized elementary and special functions
- the documentation in the doc directory requires pdflatex
- cmake ist the used build system
- only linux as host and target system was tested and
- gcc or clang are the only compilers are used to date
create a build directory in the root directory of the project, configure and build
- mkdir build
- cd build
- CC=clang-16 CXX=clang++-16 cmake -DCMAKE_BUILD_TYPE=release ..
You may also use gcc instead of clang:
- CC=gcc-13 CXX=g++-13 cmake -DCMAKE_BUILD_TYPE=release ..
If you want to use vectors of double's for the calculation of some elementary float functions, use -DCFTAL_CONFIG_USE_VF64_FOR_VF32=1 as an additional argument for cmake.
During the build a number of test programs are built in ./test and a pdf is created in ./doc containing some documentation.
This project is licensed under the LGPL v2.1License.