Question: Listing 1: newton.py 1 f = lambda x: x**6 - x - 1 2 fp = lambda x: 6*( 5) -1 3 4 def fpa(f)

 Listing 1: newton.py 1 f = lambda x: x**6 - x- 1 2 fp = lambda x: 6*( 5) -1 3 4def fpa(f) h- .000001 6 return lambda x: (f (x+h)-f(x-h))/(2h) 7 8

def newton(f,fp,x, tau): 9 def n(x,i): 10 while f(x) tau print("o 1.5f12:.5f.format(i,x,f(x))) x = x-f(x)/p(x) 1+= 1 12 13 14 15 n(x,0) 1617 newton(f,fp, 1.5,.0001) 18 newton(f,fpa(f),1.5,.0001) return X

Listing 1: newton.py 1 f = lambda x: x**6 - x - 1 2 fp = lambda x: 6*( 5) -1 3 4 def fpa(f) h- .000001 6 return lambda x: (f (x+h)-f(x-h))/(2h) 7 8 def newton(f,fp,x, tau): 9 def n(x,i): 10 while f(x) tau print("o 1.5f 12:.5f.format(i,x,f(x))) x = x-f(x)/p(x) 1+= 1 12 13 14 15 n(x,0) 16 17 newton(f,fp, 1.5,.0001) 18 newton(f,fpa(f),1.5,.0001) return X

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!