// output of ./demo/arith/shiftadd-log-demo.cc: // Description: //% Shift-add algorithm for computing log_b(x). arg 1: 1.41421 == x [Argument for shift-add log_b(x) computation] default=1.41421 arg 2: 2 == b [Base of the logarithm] default=2 arg 3: 16 == n [Number of iterations] default=16 -1 0.00000000 0.00000000 +1.00000000 +1.00000000 1 1.50000000 0.00000000 +1.00000000 +0.58496250 2 1.25000000 0.00000000 +1.00000000 +0.32192809 2 1.56250000 0.32192809 +1.25000000 +0.32192809 3 1.40625000 0.32192809 +1.25000000 +0.16992500 3 1.58203125 0.49185309 +1.40625000 +0.16992500 4 1.49414062 0.49185309 +1.40625000 +0.08746284 5 1.45019531 0.49185309 +1.40625000 +0.04439411 6 1.42822265 0.49185309 +1.40625000 +0.02236781 7 1.41723632 0.49185309 +1.40625000 +0.01122725 8 1.41174316 0.49185309 +1.40625000 +0.00562454 8 1.41725778 0.49747764 +1.41174316 +0.00562454 9 1.41450047 0.49747764 +1.41174316 +0.00281501 10 1.41312181 0.49747764 +1.41174316 +0.00140819 10 1.41450182 0.49888583 +1.41312181 +0.00140819 11 1.41381182 0.49888583 +1.41312181 +0.00070426 11 1.41450215 0.49959010 +1.41381182 +0.00070426 12 1.41415698 0.49959010 +1.41381182 +0.00035217 12 1.41450224 0.49994228 +1.41415698 +0.00035217 13 1.41432961 0.49994228 +1.41415698 +0.00017609 14 1.41424330 0.49994228 +1.41415698 +0.00008805 15 1.41420014 0.49994228 +1.41415698 +0.00004402 15 1.41424330 0.49998631 +1.41420014 +0.00004402 99 1.41421356 0.50000000 +1.41421356 +0.00000000 dl = -1.368670526391557729e-05 2**(-n) = 1.52587890625e-05