* rcs@xmission.com <rcs@xmission.com> [Oct 19. 2012 05:12]:
There was an old trick for calculating floating point log_2(x) back in assembly language days: Assume 1.0<=x<2.0. Square it 7 times, to convert mantissa bits (bits to the right of the binary point) into exponent bits. Decant the 7 exponent bits into the nascent logarithm; zero them out in the x^128 value, bringing it back into the 1.0 - 2.0 range. Rinse, repeat, till you've got 28 bits of logarithm. (The PDP6 had 36-bit words.)
A similar trick essentially reproduces SP's idea: Iterate: cos 2x = 2 (cos x)^2 - 1 Keeping track of the sign of cos(2^N x) will read out x/pi in binary. (I learned these from Gosper.)
Rich
[...]
Just for the record: http://www.jjj.de/predict.txt (dated 1995-November-12). I came up with this in a lecture (by Hanspeter Herzel, about nonlinear dynamics). When I posted the text to some math newsgroup the answer was roughly "This is known under the name <something>" where "This" apparently meant that the cos() functional equation is the one at the tip of the Mandelbrot antenna; but the bits-producing trick was apparently ignored. Earlier references are welcome. Equivalent techniques are possible for other periodic functions and I recall having seen a nice paper about this, but cannot find it right now. Regards, jj