About the parser

Many applications require the parsing of mathematical expressions. The main objective of this library is to provide a fast and easy way of doing this. muParser is an extensible high performance math expression parser library written in C++. It works by transforming a mathematical expression into bytecode and precalculating constant parts of the expression.

math expression parser - related links .NET math parser

muParser C# wrapper
a math parser for .NET


math expression parser
muParserX
a math parser with support for arrays, strings and complex numbers.

math expression parser
muParserSSE
a muParser version with a just in time compiler based on asmjit
The library was designed with portability in mind and should compile on every standard compliant C++ compiler. Wrapper for C and C# exist. The parser archive contains ready to use project and makefiles files for a variety of platforms. The code runs on both 32 bit and 64 bit architechtures and has been tested using MS VC++ V8.0 and GCC V4.4.1. Code samples are provided in order to help you understand its usage. The library is open source and distributed under the MIT license.
muParser download

Before I go on, I'd like to thank SourceForge for hosting this project. This pages would not exist without the webspace provided by them and of course I'd like to thank CodeProject for hosting the original math parser article.

Support this project

muParser is free software and anyone can use it free of charge for commercial and noncommercial purposes. If you wish you can support this project by making a small donation:

Support This Project

A project like muParser requires permanent maintanence in order to adopt to new platforms, new compiler version and for fixing bugs. So if you are using the library and find it useful i would like to encourage you to make a donation in order to help keeping the project up to date. I can officially guarantee that you make my day by donating even a small amount of money. In a way this is a "Wow the people actually really appreciate what i'm doing" kind of thing and that's whats driving me and ultimately this is what is keeping this project alive.

Release Notes

Rev 2.0.0: Official release planned for mid 2011

The next version will be V2.0.0. There have been lots of internal changes so this will be a major release. Originally this was intended to be V1.36 but starting with the next version I will use a version scheme that is compatible with the SONAME version numbers as used by GNU/Linux. Downstream package maintainers had to deal with problems related to broken ABI compatibility in the past originating from incompatible version shemes. This change will make life easier for Linux package maintainers and people using the library. Version 2.0.0 will introduce if-then-else conditionals with lazy evaluation. Expressions can now have multiple comma separated subexpressions and you can retrieve all results of these subexpressions. It will add a bulk mode for evaluating large numbers of equations at once and it will add a compiler switch to activate OpenMP support for the bulk mode. The parsing engine was rewritten and the low level bytecode is now using unions internally to represent the tokens in the reverse polish notation of an expression. The official release is planned for Summer 2011 but a prerelease is already available via svn:
svn co https://muparser.svn.sourceforge.net/svnroot/muparser/trunk muparser
I encourage early adopters to report back any bugs/issues they find when working with the prerelease version but please do not use the prerelease as the base for binary distributions. It may still be subject to minor changes!

Rev 1.34: 04.09.2010

This is the second service release of 2010.

Rev 1.32: 30.01.2010

This is a service release to fix problems with modern compilers.

Rev 1.30: 09.06.2008

This is a service release with minor extensions and bugfixes.

Rev 1.28: 02.07.2007


Rev 1.2: 14.04.2005

First of all the interface has changed so this version is not backwards compatible. After receiving a couple of questions about it, this version features support for user defined binary operators. Consequently the built in operators can now be turned off, thus you can deactivate them and write complete customized parser subclasses that only contain the functionality you want. Other new feature is the introduction of callback functions taking string arguments, implicit generation of variables and the Assignement operator.