Question: Please fill in the part of the code where stated #YOUR CODE HERE, written in python Find a function f(x) with a root at x

Please fill in the part of the code where stated #YOUR CODE HERE, written in pythonPlease fill in the part of the code where stated #YOUR CODE

Find a function f(x) with a root at x 0 where bisection and Newton both converge, but Newton has an error of at least 10-2 -.01 even when the residual is smaller than 10-10. @tests.add("newton_inaccurate' def f(x): # YOUR CODE HERE raise NotImplementedError() plotf(tests plot_conv (tests, (bisect, newton)) newton inaccurate 1) h newton(tests smallresid np.abs(h[:,1]) 1e-10 newton_inaccurate'], -1, 3) assert np.sometrue(smallresid) assert np.sometru e(h[smallre sid print( Tests pass > 1e-2) Find a function f(x) with a root at x 0 where bisection and Newton both converge, but Newton has an error of at least 10-2 -.01 even when the residual is smaller than 10-10. @tests.add("newton_inaccurate' def f(x): # YOUR CODE HERE raise NotImplementedError() plotf(tests plot_conv (tests, (bisect, newton)) newton inaccurate 1) h newton(tests smallresid np.abs(h[:,1]) 1e-10 newton_inaccurate'], -1, 3) assert np.sometrue(smallresid) assert np.sometru e(h[smallre sid print( Tests pass > 1e-2)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!