  Let $z_{1},z_{2},...,z_{N}$ be a sequence of distinct grid points. A finite
difference formula approximates the $m$-th derivative $f^{(m)}(0)$ as $\sum
w_{k}f(z_{k})$, with $w_{k}$ being the weights. We derive an algorithm for
finding the weights $w_{k}$ which is an improvement of an algorithm of Fornberg
(\emph{Mathematics of Computation}, vol. 51 (1988), p. 699-706). This algorithm
uses fewer arithmetic operations than that of Fornberg by a factor of
$4/(5m+5)$ while being equally accurate. The algorithm that we derive computes
finite difference weights accurately even when $m$, the order of the
derivative, is as high as 16. In addition, the algorithm generalizes easily to
the efficient computation of spectral differentiation matrices.
  The order of accuracy of the finite difference formula for $f^{(m)}(0)$ with
grid points $hz_{k}$, $1\leq k\leq N$, is typically $\mathcal{O}(h^{N-m})$.
However, the most commonly used finite difference formulas have an order of
accuracy that is higher than the typical. For instance, the centered difference
approximation $(f(h)-2f(0)+f(-h))/h^{2}$ to $f"(0)$ has an order of accuracy
equal to 2 not 1. Even unsymmetric finite difference formulas can exhibit such
superconvergence or boosted order of accuracy, as shown by the explicit
algebraic condition that we derive. If the grid points are real, we prove a
basic result stating that the order of accuracy can never be boosted by more
than 1.
