Python 3.4.0 (v3.4.0:04f714765c13, Mar 16 2014, 19:24:06) [MSC v.1600 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> >>> ================================ RESTART ================================ >>> >>> def f(x): return x*x-2 >>> d(1) Traceback (most recent call last): File "", line 1, in d(1) NameError: name 'd' is not defined >>> f(1) -1 >>> f(2**0.5) 4.440892098500626e-16 >>> NR(f, diff_param(f)) 27.426166219459233 750.1945934974068 13.749793971109312 187.056834247954 6.947872694331258 46.27293497663389 3.6181049190375183 11.090683205163486 2.0856520189133674 2.3499443439974055 1.5224274018450594 0.3177851938886982 1.4180937371202247 0.010989847259605057 1.4142202365639922 1.8877507113934655e-05 1.4142135647476761 6.7163297146066725e-09 convergence in 8 iterations 1.4142135647476761 >>> NR(f, diff_param(f), 10**(-12)) 0.8311527217157959 -1.3091851531844247 1.6182511818058412 0.6187368874160017 1.4271356804333983 0.03671625036609871 1.414276569783069 0.00017821583736399305 1.4142135860437386 6.695069076911864e-08 1.4142135623814611 2.3662849457650736e-11 1.414213562373098 8.43769498715119e-15 convergence in 6 iterations 1.414213562373098 >>> NR(f, diff_param(f), 10**(-12)) -38.2667081361564 1462.3409515777787 -19.15923678208254 365.0763540719046 -9.631563892587307 90.76702301699156 -4.91936262233718 22.200128610048132 -2.662730315793093 5.090132734643584 -1.7067400123906347 0.9129614698951838 -1.439203949683914 0.07130800878577803 -1.4144219197181747 0.0005893669792467193 -1.414213504044357 -1.6497858124076004e-07 -1.414213562393726 5.835287808508838e-11 -1.4142135623730878 -2.042810365310288e-14 convergence in 10 iterations -1.4142135623730878 >>> NR(f, diff_param(f), 10**(-12)) 53.57575738701516 2868.361779592309 26.806793675422 716.6041871566449 13.4409501137382 178.65913995999892 6.795121782407884 44.1736800377541 3.5449644419787028 10.566772894893376 2.054782680488823 2.2221318640368324 1.5141923555831398 0.29277848970641784 1.4175461658049682 0.00943713218836617 1.4142186534799341 1.4399850598145747e-05 1.4142135641815912 5.1151993751830105e-09 1.4142135623737342 1.807887173299605e-12 1.4142135623730951 4.440892098500626e-16 convergence in 11 iterations 1.4142135623730951 >>> NR(f, diff_param(f), 10**(-12)) -25.443576867207526 645.3756037974979 -12.760841851218299 160.83908475180445 -6.458538722222854 39.71272242645201 -3.3838651150640606 9.450543116947507 -1.9872462466373269 1.9491476447741434 -1.4967086029716326 0.2401366422092961 -1.416460219914491 0.006359554600207762 -1.4142145513883677 2.7973586020912933e-06 -1.4142135620236478 -9.883860396797672e-10 -1.4142135623732186 3.494982081519993e-13 convergence in 9 iterations -1.4142135623732186 >>> NR(f, lambda x:2*x, 10**(-12)) 7.417192850141035 53.01474977618329 3.8434183206588175 12.771864387575844 2.181894213469444 2.7606623587714445 1.5492644686978823 0.4002203939697315 1.4200998224880241 0.016683505830517475 1.414225761535996 3.45045920679965e-05 1.4142135624257104 1.4881873511285448e-10 1.414213562373095 -4.440892098500626e-16 convergence in 7 iterations 1.414213562373095 >>> NR(f, lambda x:2*x, 10**(-12)) 65.23566277570583 4253.691697785612 32.63316042656351 1062.9231594258306 16.347223889435963 265.2317288913458 8.234784410866576 65.81167429345118 4.238828292901516 15.967665296702382 2.3553283970172725 3.5475718577959547 1.602233443827622 0.5671520085197215 1.425245499060711 0.03132473259281543 1.4142562580445284 0.00012076341811173563 1.4142135630175752 1.822864970080218e-09 1.4142135623730951 4.440892098500626e-16 convergence in 10 iterations 1.4142135623730951 >>> NR(f, lambda x:2*x, 10**(-12)) 46.36088178240473 2147.331359642107 23.202010800176346 536.3333051714998 11.644105112807573 133.58518387811145 5.90793292164543 32.90367140666191 3.123230400217864 7.754568132845041 1.8817965097972098 1.5411581042849605 1.472305341049362 0.16768301728247836 1.4153596068299354 0.0032428166457894037 1.4142140263604417 1.312354612093003e-06 1.414213562373171 2.149391775674303e-13 convergence in 9 iterations 1.414213562373171 >>> NR(lambda x: x**2+1, lambda x:2*x) 12.354744011440829 153.63969958823301 6.136901721630596 38.661562740952576 2.986976523653003 9.922028752854178 1.326094914058066 2.75852772109067 0.2860005392711489 1.081796308463388 -1.6052481821827782 3.5768217264011137 -0.4911457754329893 1.2412241727256723 0.772454803877116 1.5966864240328338 -0.26105965937608855 1.0681521457535594 1.7847411899515262 4.18530111510959 0.6122179303680839 1.37481079426418 -0.5105936748372735 1.2607059007838313 0.7239554029451913 1.5241114254535344 -0.32867257610790546 1.108025662285407 1.3569345338714112 2.841271329212824 0.3099896524899506 1.0960935846508404 -1.4579622385596613 3.125653889065899 -0.38603670907757737 1.1490243407554461 1.1021952566090587 2.2148343836915085 0.09745749784500712 1.0094979638862096 -5.081712839011366 26.823805378172956 -2.4424643977917455 6.965632334480194 -1.01652092431105 2.0333147895621915 -0.016386671816308374 1.0002685230132153 30.504408954838222 931.5189656840143 15.235813404222439 233.13001008828414 7.585089287856105 58.53357950474943 3.7266258417854714 14.887740164663274 1.7291432936675768 3.9899365300355556 0.575411111769351 1.3310979475476405 -0.5812383865820125 1.337838062036461 0.5696130479762351 1.3244590244247767 -0.5929823570363573 1.3516280757563939 0.5467042286756036 1.2988855136517867 -0.6412191909020624 1.4111620507810956 0.45915496414769796 1.2108232811014739 -0.859379491152217 1.7385331098130434 0.15212539563656202 1.0231421359975805 -3.2106995019299727 11.308591291693375 -1.449620446587717 3.101399439165172 -0.37989235104877705 1.1443181983853672 1.126216149459621 2.2683628153036555 0.1191435655723907 1.0141951892173027 -4.137045949761048 18.11514919043429 -1.947663790314571 4.793394240102522 -0.7171140763600052 1.5142525985136635 0.3386820991939934 1.11470556431445 -1.306969629916081 2.708169613522977 -0.27092045496437756 1.0733978929181054 1.7100999391200096 3.9244418017782605 0.5626693966109804 1.3165968498825646 -0.607286582701714 1.3687969935295257 0.5196912170052894 1.2700789610324388 -0.7022641667620602 1.4931749599180106 0.3608507055249701 1.1302132316778688 -1.2051892306220584 2.452481081607389 -0.1877220066818226 1.0352395517926503 2.5696519690484667 7.603111242034662 1.0902471053520675 2.188638750728562 0.08651192459146495 1.0074843130965194 -5.736294109687394 33.905070112834295 -2.7809827654193446 8.733865141559425 -1.2106988265610532 2.465791648636311 -0.19236478900346166 1.0370042120483463 2.5030458872967762 7.2652387139133054 1.0517663181156511 2.106212387922553 0.05049238889530305 1.0025494813363545 -9.877236356670293 98.55979804552945 -4.887996731004655 24.892512042312195 -2.341706971396335 6.483591539886197 -0.9573340291190828 1.916488443309377 0.04361672840955455 1.0019024189971528 -11.441683241700984 131.91211540342113 -5.677141756989756 33.22993852895674 -2.7504983903657245 8.565241395404442 -1.1934639588230196 2.424356221009514 -0.17778342524394675 1.03160694629147 2.7235189455365223 8.41755544669637 1.1781734540921538 2.3880926879274362 0.1647009982186718 1.0271264188142268 -2.953453809351231 9.722889403971298 -1.3074335849639955 2.7093825790918054 -0.2712881890330745 1.0735972815088453 1.7074143953576453 3.915263917474513 0.5608667476044475 1.3145715085683911 -0.6110439728858814 1.3733747368001619 0.5127497291564538 1.2629122847500167 -0.7187597314411043 1.5166155515412885 0.33626288960953055 1.1130727309285513 -1.3188004036088419 2.739234504558844 -0.280267773097415 1.0785500246369841 1.643874294178553 3.7023226950610355 0.5177776369791369 1.2680936813556989 -0.7067766801541027 1.4995332756096547 0.3540486963160878 1.1253504793631213 -1.2352107630075955 2.525745629049806 -0.2128161625509466 1.0452907190429108 2.243037534164114 6.0312173796690285 0.8986067594208349 1.8074941080768143 -0.10711353431575499 1.0114733092336123 no convergence, x0= 12.354744011440829 i= 99 xi= 4.614387421165452 >>> >>>