Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def findmax(a, b, e):
- temp = abs(d1f(a))
- while (a < b):
- temp2 = abs(d1f(a))
- if temp2 > temp:
- temp = temp2
- a = a + e * 2
- return temp
- def iter(a, b, e):
- c = a
- c_old = c + 2*e
- max = findmax(a, b, e)
- k = 0
- while (abs(c_old - c) >= e) and (abs(f(c)) >= e):
- c_old = c
- c = c_old - f(c) / max
- k = k + 1
- return c
Add Comment
Please, Sign In to add comment