Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- decimal.getcontext().prec=40
- x=decimal.Decimal(1)
- for k in range(8):
- ex = x.exp()
- f = 1000*ex+435*(ex-1)/x-1564
- df = 1000*ex+435*ex/x-435*(ex-1)/x**2
- print "%2d %44s %44s"%(k,x,f)
- x = x - f/df
- k x f(x)
- -------------------------------------------------------------------------------------------
- 0 1 1901.734423838729912742012521391070684281
- 1 0.3969031227481259043430888746827019616688 457.188882021901362149278051953610760865
- 2 0.1388690005458458374348832095249271495320 51.625635605039106407222909186487362447
- 3 0.1016666484810883840629040924898754077344 0.895689482788235733248531107570043312
- 4 0.1009981404995350112100984626739410398824 0.000282277360385651673393235168548724
- 5 0.1009979296857707443564783409084902454646 2.8059058649170931631933147E-11
- 6 0.1009979296857497889495568910380408930097 2.77247289341E-25
- 7 0.1009979296857497889495568908309837055733 0E-36
Add Comment
Please, Sign In to add comment