I have some expressions such as `x^2+y^2` that I'd like to use for some math calculations. One of the things I'd like to do is to take partial derivatives of the expressions.
So if `f(x,y) = x^2 + y^2` then the partial of `f` with respect to `x` would be `2x`, the partial with respect to `y` would be `2y`.
I wrote a dinky function using a finite differences method but I'm running into lots of problems with floating point precision. For example, I end up with `1.99234` instead of `2`. Are there any libraries that support symbolic differentiation? Any other suggestions? Rolling your own would be a bad idea. I've taken a cross-listed grad course in Computer Algebra, and things are not even quite feature complete. Simplistic differentiation could be done by applying maty rules and then try to substitute and evaluate... hard to do in C/C++.