title: Derivatives in C/C++?
body: <p>I have some expressions such as <code>x^2+y^2</code> 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.</p>
  
  <p>So if <code>f(x,y) = x^2 + y^2</code> then the partial of <code>f</code> with respect to <code>x</code> would be <code>2x</code>, the partial with respect to <code>y</code> would be <code>2y</code>.</p>
  
  <p>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 <code>1.99234</code> instead of <code>2</code>. Are there any libraries that support symbolic differentiation? Any other suggestions?</p>