Guest User

Untitled

a guest
Oct 19th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. decimal.getcontext().prec=40
  2. x=decimal.Decimal(1)
  3.  
  4. for k in range(8):
  5. ex = x.exp()
  6. f = 1000*ex+435*(ex-1)/x-1564
  7. df = 1000*ex+435*ex/x-435*(ex-1)/x**2
  8. print "%2d %44s %44s"%(k,x,f)
  9. x = x - f/df
  10.  
  11. k x f(x)
  12. -------------------------------------------------------------------------------------------
  13. 0 1 1901.734423838729912742012521391070684281
  14. 1 0.3969031227481259043430888746827019616688 457.188882021901362149278051953610760865
  15. 2 0.1388690005458458374348832095249271495320 51.625635605039106407222909186487362447
  16. 3 0.1016666484810883840629040924898754077344 0.895689482788235733248531107570043312
  17. 4 0.1009981404995350112100984626739410398824 0.000282277360385651673393235168548724
  18. 5 0.1009979296857707443564783409084902454646 2.8059058649170931631933147E-11
  19. 6 0.1009979296857497889495568910380408930097 2.77247289341E-25
  20. 7 0.1009979296857497889495568908309837055733 0E-36
Add Comment
Please, Sign In to add comment