Python 3.2.5 (default, May 15 2013, 23:06:03) [MSC v.1500 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ================================ RESTART ================================ >>> >>> uniform(-4,4) 1.1960312373876096 >>> uniform(-4,4) -3.9547060229511724 >>> uniform(-4.,4.) 2.4322710619911376 >>> NR(lambda x: x**2-2, diff_param(lambda x: x**2-2)) -43.7123456732895 1908.769164261151 -21.878799927636674 476.68188627355454 -10.984857348697707 118.66709097123801 -5.5832172160871325 29.17231448201175 -2.970482829511361 6.8237682404218205 -1.8216936559479204 1.3185677761209003 -1.4596871851328537 0.13068667844107384 -1.414906542946362 0.0019605252724255173 -1.4142134871618697 -2.1272946426620365e-07 -1.4142135623996976 7.524336709252566e-11 convergence in 9 iterations -1.4142135623996976 >>> NR(lambda x: x**2-2, diff_param(lambda x: x**2-2)) -9.075784435986222 80.36986312848974 -4.647831588037137 19.602338470755818 -2.5388430104621427 4.445723831772476 -1.6631292449370112 0.7659988853647528 -1.432771548626329 0.05283431055308929 -1.4143273120554885 0.0003217456261030982 -1.4142135267213958 -1.0083823198669961e-07 -1.4142135623857048 3.566569262147823e-11 convergence in 7 iterations -1.4142135623857048 >>> NR(lambda x: x**2-2, diff_param(lambda x: x**2-2)) -86.42378882217952 7467.071274380682 -43.223215365201916 1866.246346506627 -21.63449366248437 466.0513160320764 -10.863220376040271 116.00955693841652 -5.523418147752026 28.508148034916424 -2.9425227522165813 6.658440147312245 -1.8109135316052347 1.2794078189509435 -1.457566686639746 0.12450064600196775 -1.4148436434380989 0.0017825353771940833 -1.414213479974833 -2.3305747287594158e-07 -1.41421356240224 8.243450366762772e-11 convergence in 10 iterations -1.41421356240224 >>> NR(lambda x: x**2-2, diff_param(lambda x: x**2-2)) 65.9515186930793 4347.602817923587 32.991171883101494 1086.4174222203465 16.526146617489932 271.1135220227739 8.323831644058496 67.28617323862956 4.282295571508578 16.338055361761977 2.3748901059699343 3.640103015433886 1.6086784832377317 0.587846462432049 1.426024269129249 0.033545216145609125 1.4142665945941735 0.0001500005850001429 1.4142135821094381 5.58228085978385e-08 1.4142135623800705 1.9729551326008732e-11 convergence in 10 iterations 1.4142135623800705 >>> ================================ RESTART ================================ >>> >>> NR(lambda x: x**2-2, diff_param(lambda x: x**2-2)) 89.26877806278998 7966.914736823653 44.64584109249486 1991.2511268563028 22.34556879543136 497.3244447913558 11.217784992750575 123.83870014358001 5.698282670265219 30.47042539024492 3.0248673855210217 7.149822699988782 1.8432220200344098 1.3974674151397304 1.4642420545204722 0.1440047942263334 1.4150850054066322 0.00246557252668822 1.4142141384091464 1.6292763245218111e-06 1.4142135625767998 5.761640053947303e-10 convergence in 10 iterations 1.4142135625767998 >>> def f(a = random()): return a >>> f() 0.8864050477620644 >>> f() 0.8864050477620644 >>> f() 0.8864050477620644 >>> f() 0.8864050477620644 >>> NR(sin_by_million, diff_param(sin_by_million)) 89.26877806278998 0.9646131484635391 89.27028489976173 0.651923600015853 89.26837709867429 0.143728738212674 89.26854020569155 0.38944504413326003 89.26895805331415 -0.37484475538640544 89.26936083947741 0.27450442923557494 89.26895415827896 0.9076588132998227 89.27017370507569 0.5045189413941272 89.27071346126789 0.9029429700808553 89.2719165722291 -0.9475861161753287 89.27331239682256 -0.28416823077892384 89.27362223551792 0.994630020976891 89.27553186979732 0.9392444783451033 89.28291542957126 0.8930740543068089 89.28408613834877 -0.8029202843735319 89.27841246954144 -0.8303320735276292 89.26988956230821 0.9367896137267966 89.27765477678884 0.39932477185310755 89.2769702257197 0.6645635464616977 89.27493819306423 -0.9648050410916108 89.27964967311067 -0.3855160450218348 89.27900093230062 0.9234423405534864 89.28028096278065 0.22341209796032055 89.27996550235683 -0.8799917424654621 89.28109679855677 -0.6838308728664436 89.28185443576112 0.23733867497449304 89.28211607627274 0.6041478323247768 89.28058476460644 0.6498202704439917 89.28129660303026 -0.9048963500887689 89.30183666292744 -0.9936749355661357 89.30474215649976 0.8297345345953718 89.29631164461422 0.5973270177566918 89.29695771202027 0.9855765933781722 89.30034020092694 -0.3842236444823638 89.29969473329781 -0.865810736780636 89.30078704054142 -0.9034818270844017 89.32284461962696 0.9999006980522088 89.32507042912091 -0.0051916584174391866 89.32506413312169 0.007622166228311499 89.32507331434016 -0.24854877495194566 89.32534653442612 0.34257522958364656 89.32571618130733 0.987213293565242 89.32746707537964 -0.3743950421444894 89.32786939842933 -0.18350836725679578 89.32807486162935 -0.8796487961694962 89.22248575909649 -0.78436860613534 89.21786239261417 -0.9253702991618314 89.21915048801273 -0.90846668674722 89.22037291841083 0.7094692889205706 89.22116720950758 -0.968861224188488 89.22270818368703 0.2698042301148573 89.22231032619966 -0.985102555776843 89.22572010923375 0.5552124279561573 89.22631666578503 0.8044038229577889 89.22727058844482 0.88449687444831 89.90927885082796 0.840729887200758 89.89874297573797 0.898479043915261 89.89993111489005 0.4786914068288601 89.90044282613393 -0.7627289184477475 89.90132099540581 -0.7155416826441693 89.89861570580483 0.4069138197034557 89.89791079139562 -0.7022705149168953 89.898694582236 -0.6857894226810965 89.89642140144373 -0.8692167238887712 89.89752275966465 0.679569940226742 89.89532502393628 0.8496320791992602 89.89637668791173 -0.9771776880552367 89.90025461224702 -0.5529078429325193 89.90084852682867 0.4189420616671648 89.90129699842642 -0.9350611737054971 89.9026283877293 -0.9600494283801277 89.9077146983371 0.9777137936873554 89.91155986146268 0.9366701616687754 89.91934451459154 0.8412176567005549 89.90869032859263 0.04576329764238739 89.90874441975446 0.5958369873484306 89.90726709166456 -0.14076619268740614 89.90742700810304 0.43138023940196846 89.90788849229054 -0.7003978195147222 89.90866957934564 0.9306269690298208 89.91756238666477 -0.15402352679104542 89.91735691474015 -0.897365605203003 89.91854140277589 0.8447820239908044 89.91958156170615 -0.6551610355352842 89.92030040445485 0.9625793930469263 89.92179201449581 -0.931588471923285 89.93049033903851 0.4378836902367216 89.9296967318993 -0.9951774335788268 89.93162305555904 0.8106047441034847 89.93258926547435 0.7144142120915673 89.92990293281096 -0.5010762854036338 89.92889331444655 -0.5990231437930512 89.92954142991937 0.30039387319278843 89.92908437058045 0.9402277847551267 89.93044101482099 0.9845014594191478 89.93388545565301 0.4722139347556167 89.93439021022498 -0.9993100045391063 89.93652534753443 -0.4459646328285407 89.93570696704084 0.8930829814044963 89.93687770401287 -0.8193939403977967 no convergence, x0= 89.26877806278998 i= 99 xi= 89.92977778429065 >>> NR(sin_by_million, diff_param(sin_by_million,h=0.000001)) 89.26877806278998 0.9646131484635391 89.26877951268096 -0.14540148030550443 89.26877932278438 0.04396365585508603 89.2687793738534 -0.007091131426803901 89.26877936539336 0.0013688535766268849 89.26877936701888 -0.000256668964223961 89.26877936671382 4.838760489942542e-05 89.26877936677131 -9.101074967431065e-06 89.2687793667605 1.7171680591758495e-06 89.26877936676254 -3.3919218557427674e-07 89.26877936676215 6.313916665960343e-08 89.26877936676222 -1.1366639309634812e-08 89.2687793667622 3.534521884212844e-09 convergence in 12 iterations 89.2687793667622 >>> ================================ RESTART ================================ >>> >>> NR(sin_by_million, sin_by_million_deriv) 14.668998708983665 -0.8261732063321943 14.668997242619755 0.47422414191494294 14.668997781263448 -0.044546377403946555 14.668997736672805 2.9519278798309163e-05 14.668997736702325 7.847758407746389e-11 convergence in 4 iterations 14.668997736702325 >>>