For the purposes of what I want to do I need to take a user input as a string and convert it into an unevaluated function. For example, if the user input was "x^2*sin(x)" I would need a function that took a double input x and returned
Math.Pow(x, 2)*Math.Sin(x)
I need the function, I can't pass in a value for x and I will be calling the function many times (hundreds possibly) so I can't parse the string each time I am making a calculation.
How would I implement this? I take it from the question Convert a string into mathematical equation? that there is not a standard way to do this. But I am a little lost as to how to "save" a mathematical formula, is there a way to create a delegate with the math expression?
At the very least, I need it to recognize basic algebra equations, powers, exponentials, and trig functions. Also, although I used the example of a function of a single variable x, I want to be able to parse a function of multiple variables.