Numerical Differentiation. What is the best method? What is the best method for 1D numeric differentiation? Something as glorious as Gaussian quadrature for numeric integration.
Maybe differential quadrature is such a method? What is its accuracy?
I'm well aware that it is really easy to have symbolic differentiation in the program (automatic differentiation or truly symbolic algorithm). However to use such methods it is necessary to rewrite all functions to be differentiated. Thus one can't differentiate functions imported from libraries.
I need differentiation almost with the machine precision.
 A: Use auto-differentiation. Automatic differentiation is faster than other forms of differentiation and gets errors at machine epsilon. However, it's much harder to implement, so you might need to use a package for it. That said, since it's so useful there are plenty of packages, one I use very often is ForwardDiff.jl. 
It's a shame that less academics don't use automatic differentiation because it really is what should be the workhorse, and it's just not taught in graduate school for some reason (though those who go into machine learning know it as "backwards propagation").

Edit
One can autodifferentiate functions from libraries in Julia since the libraries themselves are written in Julia and are "duck-typed", and so ForwardDiff.jl can auto-differentiate library functions (including ones which use loops, conditionals, etc.) due to its type system. The only problem it runs into is when there are C/Fortran libraries called, so really you just have to avoid library functions which internally call BLAS (so no matrix multiplications and you're good). 
Edit 2
ForwardDiff will now use generic linear algebra fallback function to compute the derivatives, so those will be fine as well. The only Base library functions I can think of where automatic differentiation will fail now (in Julia) is when trying to differentiate a function which calculates an FFT, since that uses FFTW and doesn't have a Julia fallback (for now).
A: In addition to J.M. answer: this paper http://www.sciencedirect.com/science/article/pii/S0021904512000123 (Differentiation by integration using orthogonal polynomials, a survey, by E. Diekema and T.H. Koornwinder) provides further insight into Lánczos's derivative and its generalizations for  n-th order derivatives. By the way, it says that the Lánczos's (1956) derivative formula goes back to Cioranescu (1938) and Haslam-Jones (1953). 
A: Complex step differentiation (CSD) is well known as an efficient numerical differentiation method:
$$f^\prime(x)=\mathrm{Im}\frac{f(x+\mathrm{i}h)}{h}+O(h^2),\quad\mathrm{i}:=\sqrt{-1}.$$
This method requires the function to be analytic (differentiable as a complex function).
We cannot apply this method to higher order derivatives, but since this method does not use differences it is useful to avoid subtractive cancellation (loss of significance caused when we try to subtract similar numbers). For the derivation and implementations, check the article on SIAM News and the post on Mathworks Blog.
A noteworthy alternative to CSD is the approach by dual numbers. Dual numbers are defined by:
$$x=a+b\epsilon,\quad a,b\in\mathbb{R},\quad\epsilon^2=0.$$
By using Taylor expansion and dual numbers, we obtain
$$f(a+b\epsilon)=f(a)+bf^\prime(a)\epsilon\quad(\because\epsilon^2=0).$$
Hence we can obtain the derivative by dual numbers.
A: If your function is badly behaved (e.g. noisy, very oscillatory), no method will perform properly (differentiation is numerically very unstable). That being said, for "nice functions", I have good experience with polynomial (Richardson) extrapolation methods. This paper and this paper give hints on how you might write your own implementation. I will note that this is the method implemented in the NAG numerical libraries (with of course a few wrinkles of their own).
There are two possible alternatives if for some reason you don't want to use Richardsonian methods. One is to use Cauchy's differentiation formula:
$$f^\prime(x)=\frac1{2\pi i}\oint_\gamma \frac{f(t)}{(t-x)^2}\mathrm dt$$
where it is up to you to choose a suitable counterclockwise contour $\gamma$ (a circle is customary); the other is to use the "Lanczos derivative":
$$f^\prime(x)=\lim_{h\to 0}\frac{3}{2h^3}\int_{-h}^h t\;f(x+t)\mathrm dt$$
where you either will have to experiment with an appropriate step size $h$, or use some extrapolative procedure.
You will have to experiment with your computing environment to choose.
A: Warning: self-promotion
I presume the "numerical" aspect of numerical differentiation is very well studied, what is little bit forgotten is "statistical" aspect. To increase the precision of numerical differentiation do the following:
1) Chose your favorite high-precision "standard" method based on some step size H.
2) Compute the value of the derivative with the method chosen in 1) many times with different but reasonable step sizes h. Each time you may pick h as a random number from the interval (0.5*H/10, 1.5*H/10) where H is an appropriate step size for the method you use.
3) Average the results.
Your result may gain several orders of magnitude in the absolute error wrt. the non-averaged result. It is time-consuming method, but we discuss here precision and not time consumption. I franky believe it is the most precise method of numerical differentation at the market today (yet systematically refused by journals)
https://arxiv.org/abs/1706.10219
