Skip to content
DeepForgeby svx
All problems
HardCalculusca-290

Richardson Extrapolated Derivative

Problem

Richardson extrapolation combines central differences at step h and h/2 as R = (4 * D(h/2) - D(h)) / 3, cancelling the leading O(h^2) error term.

Given polynomial coefficients, x, and h (default 1e-3), return the extrapolated derivative using central differences for D.

Hint

Compute two central differences, then apply the 4-to-1 weighted combination.

Test cases

case 1
in: [[1,2,3],2]
expected: 14.000000000004675
case 2
in: [[0,1,0,4],1.5]
expected: 27.999999999997215
case 3
in: [[0,0,1,1],-2]
expected: 8.000000000001043
Starter codePython
def richardson_extrapolated_derivative(coeffs, x, h=1e-3):
    # Your code here
    pass

3 test cases · run your code against them in the editor