Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Zad_4
- #Bisection_method
- def t(x):
- import math
- return 2 * x**3 - 3 * x**2 - 10*x + 25
- def granice(xmax,xmin,precision):
- while abs(xmax-xmin)>precision:
- xmid = (xmin + xmax) / 2
- xmidValue = t(xmid)
- if(xmidValue) > 0:
- xmax = xmid
- elif(xmid < 0):
- xmin = xmid
- else:
- return(xmid,xmidValue)
- break
- return(xmid,xmidValue)
- granice(float(input("X max : ")),float(input("X min : ")),float(input("Precision : ")))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement