Answered step by step
Verified Expert Solution
Question
00
1 Approved Answer
1. Give examples of functions producing every possible output in the last component (i.e. 1,-1,-2,-3,-10) for root in the last component. import numpy as np
1. Give examples of functions producing every possible output in the last component (i.e. 1,-1,-2,-3,-10) for root in the last component.
import numpy as np def f(x): return v e 10.0*"(-14) #desired size of solution interval epss-10*"(-12) #maximum error of function evaluat a -2.0 b 5.0 def root(a,b,e,epss,f): C (a+b)/2 fa-f (a) fb-f (b) if np.abs(fa)-0: while np.abs (a-b)>e: return [a,b,c,-2] return [a,b,c,-3] return [a,b,c,-10] c-(a+b)/2.0 fc-f(c) if np.abs (fc) epss: return [a,b,c,-1] if fa*fc-0: while np.abs (a-b)>e: return [a,b,c,-2] return [a,b,c,-3] return [a,b,c,-10] c-(a+b)/2.0 fc-f(c) if np.abs (fc) epss: return [a,b,c,-1] if fa*fcStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started