Egyptian multiplication and some of its ramifications
Fast exponentiation with an integer exponent relies on squaring of the base being compensated by halving the exponent when even. Likewise one can raise to a fractional power where doubling the exponent is compensated by taking the square root of the base. The same phenomena recur when multiplying by repeated addition ("Egyptian multiplication"). Its counterpart is to effect division by repeated subtraction ("Egyptian division"). Logarithms can be obtained by inverting the algorithm for fractional powers. Algorithms for these tasks are collected here for comparison. They are presented as verified C code or as verification conditions in the sense of Floyd. An appendix contains an introduction to Floyd's verification conditions.
READ FULL TEXT