Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2018
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. def wlamb(x):
  2.  
  3. from math import log
  4.  
  5. e = (1+1/1E6)**1E6
  6.  
  7. y = log(x)
  8. while True:
  9. yold = y
  10. print(y)
  11. term_top = y*(e**y) - x
  12. term_bottom = (y+1)*e**y
  13. y = y - term_top/term_bottom
  14.  
  15. if abs(yold - y) < 1E-6:
  16. break
  17.  
  18. return y
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement