3 ms·
The reason the the difference in accuracy is that this method has N steps instead of 2. Another poster in the thread mentioned this as well.
by eigenspace 7y ago
The reason the the difference in accuracy is that this method has N steps instead of 2.
Another poster in the thread mentioned this as well.
- kkylin 7y agoYes and no -- of course if one uses more points the result can be more accurate. The real difference between a center difference and contour integration is that differences suffer from loss of information in finite-precision arithmetic. For example, in (f(x+h) - f(x-h))/(2h), the numerator actually contains very few bits of information when h is small. The Cauchy integral formula, in contrast, behaves quite well so long as the point of evaluation is bounded away from the contour.
- kkylin 7y agoAlso (in case anyone's still looking at this thread) the accuracy is a separate issue from numerical stability. That simple quadrature rules like trapezoid can be so accueate (error is geometric, not just algebraic to high order) is because of the smoothness of the integrand and periodicity. An N-point high-order estimate of the derivative along the real line, using finite differences, would not have these properties.