I've been searching google for a while now but can't find what I need. I need an open source mathematical expression parser & evaluator - of which there are a myriad - But one which links to a decent math library like Apache Commons Math. I need complex arithmetic, basic functions like sin, log that work on complex plane, and functions like gamma, erf.
The closest answer I found was Built-in method for evaluating math expressions in Java - but I couldn't see how, other than writing countless helper functions, to bind
- jexpr
- jruby
- jeval
- javax.script
with Commons math. Also it would take quite some work to modify my own existing (real-valued) expression parser to bind all the functions.
Plus, including a whole scripting programming language like python/ruby in my app seems overkill, where what I want to do is barely more than an old-fashioned pocket calculator.
Hasn't someone done this sort of thing already? Thanks!