Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 pythonimage text in transcribed

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

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions