Re: Computing Square Roots Message #12 Posted by Thomas Klemm on 30 Mar 2009, 3:26 p.m., in response to message #11 by cyrille de Brébisson
These are the figures copied from the newsletter where the square root of 2 is calculated:
i mantissa result increment
12 100,000,000,000 100,000,000,000 100,000,000,000
11 200,000,000,000 140,000,000,000 10,000,000,000
10 595,000,000,000 141,000,000,000 1,000,000,000
9 302,000,000,000 141,400,000,000 100,000,000
8 191,800,000,000 141,420,000,000 10,000,000
7 503,795,000,000 141,421,000,000 1,000,000
6 795,315,500,000 141,421,300,000 100,000
5 882,088,750,000 141,421,350,000 10,000
4 335,606,320,000 141,421,356,000 1,000
3 527,636,078,000 141,421,356,200 100
2 103,372,009,355 141,421,356,230 10
1 437,705,999,155 141,421,356,237 1
And that's what you get when using the Horner schema:
5 0 -10
5 10 -5
5 20 10
5 100 -500
5 110 -395
5 120 -280
5 130 -155
5 140 -20
5 150 125
5 1400 -2000
5 1410 -595
5 1420 820
5 14100 -59500
5 14110 -45395
5 14120 -31280
5 14130 -17155
5 14140 -3020
5 14150 11125
5 141400 -302000
5 141410 -160595
5 141420 -19180
5 141430 122245
5 1414200 -1918000
5 1414210 -503795
5 1414220 910420
5 14142100 -50379500
5 14142110 -36237395
5 14142120 -22095280
5 14142130 -7953155
5 14142140 6188980
5 141421300 -795315500
5 141421310 -653894195
5 141421320 -512472880
5 141421330 -371051555
5 141421340 -229630220
5 141421350 -88208875
5 141421360 53212480
5 1414213500 -8820887500
5 1414213510 -7406673995
5 1414213520 -5992460480
5 1414213530 -4578246955
5 1414213540 -3164033420
5 1414213550 -1749819875
5 1414213560 -335606320
5 1414213570 1078607245
5 14142135600 -33560632000
5 14142135610 -19418496395
5 14142135620 -5276360780
5 14142135630 8865774845
5 141421356200 -527636078000
5 141421356210 -386214721795
5 141421356220 -244793365580
5 141421356230 -103372009355
5 141421356240 38049346880
5 1414213562300 -10337200935500
5 1414213562310 -8922987373195
5 1414213562320 -7508773810880
5 1414213562330 -6094560248555
5 1414213562340 -4680346686220
5 1414213562350 -3266133123875
5 1414213562360 -1851919561520
5 1414213562370 -437705999155
5 1414213562380 976507563220
5 14142135623700 -43770599915500
As I already mentioned: looking at the same thing from a different angle.
PS: Our first lines disagree. Could it be that the first line shold read instead:
12 500,000,000,000 100,000,000,000 100,000,000,000
At which line of the program should I assume is the printing of the variables?
If I suppose it's before the while-loop then result is still 0 wheras when it's after the while-loop mantissa has already been diminished.
|