All problems
Richardson Extrapolation
Problem
Richardson extrapolation cancels the leading O(h^2) error term of a numerical approximation.
Given two estimates d_h and d_half computed with step sizes h and h/2, return the extrapolated value (4*d_half - d_h) / 3.
Hint
The weights 4/3 and -1/3 eliminate the h squared term.
Test cases
case 1
in: [1.1,1.025]
expected: 0.9999999999999999
case 2
in: [0.26,0.065]
expected: 0
case 3
in: [1,1]
expected: 1
case 4
in: [2,1.5]
expected: 1.3333333333333333
Starter codePython
def richardson(d_h, d_half):
# Your code here
pass4 test cases · run your code against them in the editor