This tool is used to generate the RLibm math library. For more information behind the techniques in RLibm-generator, please refer to this paper.
Make sure you have GMP and MPFR installed.
Install SoftPosit according to the instructions from the SoftPosit website
Install Soplex 4.0.1
Download Soplex version 4.0.1 source code.
Untar Soplex
tar -xvf soplex-4.0.1.tar
cd into soplex directory and create a build directory inside
cd soplex-4.0.1
mkdir build
cd into build directory and build soplex. Make sure you have GMP installed prior to this step.
cd build
cmake ..
make
Create 2 environment variables to specify where softposit and soplex is installed:
export SOFTPOSITPATH=<path_to_softposit_directory>
export SOPLEXPATH=<path_to_soplex-4.0.1_directory>
To run the math library function generators, use the script
cd rlibm-generator
./runFunctioonGen.sh
If you would like to generate the functions individually, the function generation scripts are in functiongen directory. Functiongen directory is organized into each representation (bfloat16, float, posit16, etc) and each directory is further organized into the method of how we generate the function. There are two ways we generate the functions:
Inside of full or sampling directory, there are cpp files that generates the polynomial for each elementary function and a makefile. You can use the makefile to compile the program and run each program that generate the polynomial for a single elementary function.