All problems
Halley Method Step
Problem
Halley's method uses the second derivative for cubic convergence: x_new = x - 2 f f' / (2 (f')^2 - f f'').
Given polynomial coefficients and the point x, return the updated point.
Hint
Evaluate f, f', and f'' at x, then apply the Halley update.
Test cases
case 1
in: [[1,0,1],1]
expected: -1
case 2
in: [[-2,0,1],2]
expected: 1.4285714285714286
case 3
in: [[-1,0,1],0.5]
expected: 0.9285714285714286
Starter codePython
def halley_method_step(coeffs, x):
# Your code here
pass3 test cases · run your code against them in the editor