How to declare the derivative of a function as a function?

Hello,
sorry if I ask for a very stupid question but I do not see how to do.
I have a function like this

Double_t myfunction(Double_t *x, Double_t *par) { return 3.*x[0]-5.; } TF1 *f = new TF1("f",myfunction,0,10);

I would like to define a function which gives me the derivative of the function f. Something like

However, I do not know how to define “myDerivativefunction” because this function have to know "f"
Any idea?

I can be wrong, but IMHO:

  1. Such feature does not exist at the moment.
  2. There is a project (GSOC 2013) on this topic so in the nearest future we’ll have this thing
    (the solution is quite sophisticated and will be cling-based AFAIK)