Skip to content

A tool to generate approximations of elementary functions that produce the correctly rounded result for all inputs. This tool can be used for different representations that approximate real numbers.

License

Notifications You must be signed in to change notification settings

rutgers-apl/rlibm-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RLibm-generator

This tool is used to generate the RLibm math library. For more information behind the techniques in RLibm-generator, please refer to this paper.

Installation

Prerequisite:

  • GMP : Needed by Soplex 4.0.1
  • Soplex 4.0.1 : Please read below on how to install Soplex 4.0.1 to use with rlibm-generator
  • MPFR
  • SoftPosit

Installation instruction:

  1. Make sure you have GMP and MPFR installed.

  2. Install SoftPosit according to the instructions from the SoftPosit website

  3. Install Soplex 4.0.1

  4. Download Soplex version 4.0.1 source code.

  5. Untar Soplex

tar -xvf soplex-4.0.1.tar
  1. cd into soplex directory and create a build directory inside
cd soplex-4.0.1
mkdir build
  1. cd into build directory and build soplex. Make sure you have GMP installed prior to this step.
cd build
cmake ..
make
  1. 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>
  1. To run the math library function generators, use the script
cd rlibm-generator
./runFunctioonGen.sh

More Detail

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:

  1. Full: We use ALL intervals when generating the LP query and feed it to the LP solver to generate the polynomial
  2. Sampling: We sample some intervals, create LP query based on the sample.

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.

About

A tool to generate approximations of elementary functions that produce the correctly rounded result for all inputs. This tool can be used for different representations that approximate real numbers.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published