restart; f:=x->x*exp(-x^2)-cos(x); df:=D(f); with(CodeGeneration): C(f); C(df); plot(f(x),x=1..2);