FunC
(Function Comparator) is a C++ tool for approximating any
univariate, pure function (without any side-effects)
Where FunC
can
build LUTs where each
FunC
aims to streamline finding a good LUT of
- absolute and relative tolerances for error
- domain usage (i.e. the inputs to
$f$ during the user's program's runtime) - evaluation frequency (i.e. how much work is being done in between calls to
$f$ )
FunC
's DirectEvaluation class measures the first two, and a
LookupTableGenerator optimizes a LUT's step size according to maximum
tolerances for error.
- C++14 compliant compiler (tested with g++ and clang++)
- Boost 1.71.0 or newer*
- Armadillo (tested with 9.1-12.6)*
*FunC will function without Boost and Armadillo. These dependancies are required for generating LUTs. They are not required when reading existing LUT data from a JSON file. Boost is needed for building a LUT according to a maximum tolerance for error. Armadillo is only needed for building ChebyInterpTables and PadeTable.
- CMake version >= 3.13
mkdir build && cd build/
cmake -DCMAKE_INSTALL_PREFIX=<install-dir> ..
make install
After make install, linking to the library (outside of cmake build) requires:
<install-dir>/lib
is in yourLD_LIBRARY_PATH
environment variable,<install-dir>/include/func
is in your include flags, and-lfunc
is used when linking
Much of FunC
's documentation is automatically generated from the source code
and comments with doxygen
; however, FunC User Manual.pdf
contains the
following extra content:
- Motivation for several of FunC's features and design decisions,
- Usage examples,
- Workflow diagram,
- FunC's UML diagram,
- More information on various LookupTable implementations
The html documentation in docs/html/index.html
is better suited for quick
reference and is entirely generated by Doxygen.
Users should check examples/experiment.cpp
for example usage of each of
FunC
's tools to benchmark several LUTs against directly evaluating
FunC
is not strictly header-only. Explicit template instantiations are compiled intolibfunc.so
; however, user-code can still instantiate templates values TIN/TOUT such that TIN approximates a field and TOUT forms an approximate vector space over TIN. Only LookupTableFactory.hpp, and LookupTableComparator.hpp are compiled into the dynamic library. By default they are only for TIN=TOUT=float and TIN=TOUT=double.
TODO reference to SISC paper
TODO decide on copyright