RLIBM-PROG is a math library generator and collection of correctly rounded elementary functions. Given an elementary function, a single polynomial approximation in RLIBM-ALL produces correctly rounded results for all inputs with multiple representations and rounding modes and has progressive performance with bfloat16 and tensorfloat32
If you are interested in the technical details of RLIBM-PROG, the following resources will be helful.
- RLIBM-PROG: Progressive Polynomial Approximations for Fast Correctly Rounded Elementary Functions
- The POPL 2022 paper on RLIBM-ALL
- The extended Rutgers DCS Technical Report DCS-TR-757 on RLIBM-ALL
- The RLIBM project page
Currently, RLIBM-PROG supports a number of elementary functions for the floating point representation.
- log(x), log2(x), log10(x)
- exp(x), exp2(x), exp10(x)
- sinh(x), cosh(x)
- sinpi(x), cospi(x)
- Reduced Intervals from the RLIBM-ALL project to generate polynomial approximations.
RLIBM-PROG has multiple correctly rounded elementary functions in the libm folder
-
float subdirectory has correctly rounded elementary functions for 32-bit floats with round-to-nearest-ties-to-even mode.
-
float-rno subdirectory has polynomial approximations that produce correctly rounded results for all inputs, rounding modes, and multiple representations from a 10-bit FP to a 32-bit float.
-
progressive subdirectory has progressive polynomial approximations that produce float-rno results but with better performance for bfloat16 and tensorfloat32.
Go to libm folder and type make.
The polynomial generator can be found in polynomial_gen directory. It needs the SOPLEX solver installed and appropriately set the following variables in polynomial_gen/Makefile
-
SOPLEX_INCLUDE
-
SOPLEX_LIB
To build the polynomial generator, type make in the polynomial_gen directory
- Running the polynomial generator
The reduced intervals take up substantial storage space. Hence, it needs to generated using the RLIBM-ALL prototype. The Log2 reduced interval file is available here: https://people.cs.rutgers.edu/~sn349/Float34ROLog2Intervals.gz
wget https://people.cs.rutgers.edu/~sn349/Float34ROLog2Intervals.gz
gunzip Float34ROLog2Intervals.gz
cd polynomial_gen
./piecewise-polygen ../Float34ROLog2Intervals
It will print out the resultant polynomial (if the system of linear inequalities is full rank)