The LaTeX Equation Compiler is a preprocessor for LaTeX files that enables numeric and symbolic calculations. It reads equations specified by special keywords in the LaTeX file, manipulates them and calculates numeric values of variables.
If your OS can install .deb packages, have a look at my PPA http://launchpad.net/~jrheinlaender/+archive/ppa