
A fast math expression parser capable of parallel expression evaluation.
muparserSSE is a mathematical expression parser that will compile a mathematical expression into machine code for Intel processors at runtime. It will take the expression as well as variable definitions as its input and return the pointer to a just in time compiled function made up of fast SSE instructions. You can extend it with custom callback functions and operators. muparserSSE is based on asmjit a just in time compiler written by Petr Kobalicek and the original muparser.
Since this is a fork of muparser its interface and features are pretty similar. However i had to remove some of muparsers more "esotheric" features in order to get the work done. A complete implementation would have taken to much time and muparser has some features that are rarely used anyway. On the other side i added some operators in order to expose as much of the SSE instructions to the user as possible. The following table compares muparserSSE with the other parsers of the muparser family. A detailed description of the differences is listed below.
Parser | Data types | Precision | User defined operators | User defined functions | Localization | Licence | Performance (Expr. per second) | ||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
complex | scalar | string | vector | Binary | Postfix | Infix | Strings as parameters | Arbitrary number of parameters | |||||
muparser | ![]() |
![]() |
![]() |
![]() |
double | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
BSD 2-Clause | ~10.000.000 |
muparserSSE | ![]() |
![]() |
![]() |
![]() |
float | ![]() |
![]() |
![]() |
![]() |
max. 10 | ![]() |
BSD 2-Clause | ~20.000.000 |
muparserX | ![]() |
![]() |
![]() |
![]() |
double | ![]() |
![]() |
![]() |
![]() |
![]() |
![]() |
BSD 2-Clause | ~1.600.000 |
Table 1: Feature comparison with other derivatives of muparser. (* Average performance calculated using this set of expressions; (1) muparser can define strings but only as constants.)
The current release contains a DLL and Project files for 32 bit Windows only. Since both asmjit and muparser are running on Linux too compiling the library under Linux should be possible but hasn't been tested. The following features are supported by muparserSSE:
Special thanks to Petr Kobalicek for writing the asmjit just in time compiler and making it available as open source. Writing muparserSSE wouldn't have been possible without asmjit!