OptiFloat.jl: Automatic Floating Point Expression Optimization in Pure Julia
- Mentors
- Shashi Gowda, Alessandro Cheli
- Organization
- The Julia Language
- Technologies
- julia
- Topics
- Symbolic Computation, Julia, metaprogramming, E-Graphs, Metatheory.jl, Symbolics.jl, Floating point optimization
Most scientific and engineering applications heavily depend on floating point arithmetic. Floating point numbers only approximate the real numbers, which can lead to accumulation of errors and ultimately to unusable results.
Current state of the art of floating point arithmetic optimization is done in Rust (egg)
or Racket (Herbie). This is not very accessible for the actual target group
of scientists & engineers who are used to program in high-level languages such as Python, MATLAB and Julia.
Additionally, it requires manual labour (rewriting symbolic expressions, then
optimizing them, and finally translating the resulting code back to the
original language) due to the necessity of interfaces to interoperate between different systems written in different languages.
We propose to take advantage of Julia's homoiconicity and powerful existing symbolic-numeric ecosystem to implement an automatic floating point expression optimizer in Julia, acting on any expression that supports TermInterface.jl, such as Symbolics.jl expressions as well as native Julia code.
The project will include a package that implements the floating point expression optimization apporach (OptiFloat.jl). To achieve this Metatheory.jl will be fully integrated with Symbolics.jl, enabling e-graph based optimization of any symbolic expression (not just numerical). Additionally we will finalize the release of Metatheory.jl v3.0,
identify existing Julia packages that may suffer from numerical error propagation, and perform a thorough comparison of automatically optimized expressions vs. original vs. external system including the time required to obtain them.