Approximate Math
Goal of this exercise is to learn how to speed-up software choosing the
appropriate precision in floating point math
- use reciprocal instructions to speed-up divisions and square-roots
- check if the compiler can generate the same code (hint: try
fast-math)
- using algorithm based on look-up tables or small-polynomial
expansions find the best accuracy
- to fill a typical eta-phi histogram (user defined bins)
- to build and fill a log scale "histogram" (either optimized or
user-defined bins)
- to sample and interpolate a function in log scale
Code
in examples:
approxMath.cpp
approxLog.cpp
approxPhi.cpp
References
Fast
inverse square root on Wikipedia (and references therein)
icsi-log
technical paper
fast math in vlfeat