Writing a new module ?



You mention AD  (automatic differentiation).  Have you seen this?

http://www.cs.berkeley.edu/~fateman/papers/overload-AD.pdf