Automatic Differentiation in c++