Factoring Algorithm for Exponentiation.
1 | x0=X, y0=1, g(i)=log(1+2-i), i=1,2,…,n | ||
2 | for i=1 to n | ||
3 | a = xi – g(i) | ||
4 | if a > 0 | ||
5 | xi+1 = a | ||
6 | yi+1 = yi + yi·2-i | ||
7 | else | ||
8 | xi+1 = xi | ||
9 | yi+1 = yi | ||
10 | end if | ||
11 | end for |
1 | x0=X, y0=1, g(i)=log(1+2-i), i=1,2,…,n | ||
2 | for i=1 to n | ||
3 | a = xi – g(i) | ||
4 | if a > 0 | ||
5 | xi+1 = a | ||
6 | yi+1 = yi + yi·2-i | ||
7 | else | ||
8 | xi+1 = xi | ||
9 | yi+1 = yi | ||
10 | end if | ||
11 | end for |