Finite difference coefficient (source code)

= Finite difference coefficient
{wiki}

Finite difference coefficients are the weights in a linear combination of sampled function values approximating a derivative. Matching polynomial moments determines the weights and approximation order. Forward, backward and centered stencils have different coefficients.