4 ms·
For those who are interested, CORDIC (for COordinate Rotation DIgital Computer) is another technique from that era. It "is a simple and efficient algorithm to
by raymondh 10y ago
For those who are interested, CORDIC (for COordinate Rotation DIgital Computer) is another technique from that era. It "is a simple and efficient algorithm to calculate hyperbolic and trigonometric functions, typically converging with one digit (or bit) per iteration." See https://en.wikibooks.org/wiki/Digital_Circuits/CORDIC https://en.wikibooks.org/wiki/Digital_Circuits/CORDIC
For instructional purposes, here is a simple Python implementation that uses only adds and shifts in the inner loop, followed by a single scaled-multiply to finish it up: https://code.activestate.com/recipes/576792-polar-to-rectangular-conversions-using-cordic https://code.activestate.com/recipes/576792-polar-to-rectang...
- bsder 10y agoIIRC, CORDIC has some issues as you scale the number of bits you want--you can't just run CORDIC 64 times for 64-bits of accuracy, for example. I think the point of diminishing returns is 14-16 bits, but it's been a long time and I'd be happy to be proven wrong.
- planteen 10y agoI used CORDIC on a FPGA a few years ago to compute atan2.