Choosing Mathematical Function Implementations for Speed and Accuracy
summary
A tool named optuner selects among 45 cosine and 49 sine implementations (about 4.8 million configurations) by building a linear error model from Taylor expansions, a simple additive cost model, and encoding a multiobjective ILP solved with Z3 to extract the Pareto frontier. Evaluation uses 36 FPBench-derived kernels (avg run 5 minutes, worst 30) and a ray tracer case where glibc costs 27 ns per photon, a table lookup 12.7 ns, and the chosen configuration runs 10.85 ns while producing bit-for-bit equal images to glibc.
AI-written summary · about
chapters (8)
- 0:00Start
- 3:33POV-Ray hand rolled code
- 6:13OpTuner Input
- 6:53Modeling Error and Speed
- 9:37Error Taylor Series
- 10:06Linear Cost Model
- 13:37Benchmark Results
- 14:33What about ray tracing?
related talks
26mGenerating Correctly Rounded Math Libraries for New Floating Point Variants
14mFast and Efficient Bit-Level Precision Tuning
58mPortable floating-point calculations
01h 00mBeating Hand Tuned Assembly in Compiled Languages
19mCryptOpt: Verified Compilation with Randomized Program Search for Cryptographic Primitives
20mImplementation and Synthesis of Math Library Functions
14mPerformance Interfaces for Hardware Accelerators
22mOne Polynomial Approximation to Produce Correctly Rounded Results of an Elementa
