RichTW wrote:
Thanks for links Ed! Will try digesting that with a coffee! A skim read suggests that Goldschmidt division works with reals rather than integers, but I haven't really taken it in properly.
I have a paper describing the algorithms and how to estimate the initial value of the reciprocal of the square root. It is based on an estimate derived for how the initial value for the floating point algorithm can be derived from the exponent of the floating point value. My initial estimate is based on the most significant bit of the fixed-point value for which I want to calculate the reciprocal of the square root. In my application, I only have to calculate the Law of Cosines twice in each control loop cycle. Therefore, I only looked for an initial value that would limit the number of iterations equally for the ranges in which I binned the input data. I also wanted the accuracy to be about the same for each of these bins, so I biased my estimate to accomplish this.
I'll have to sanitized the paper somewhat to remove some stuff that is not suitable for public disclosure. If the preceding is insufficient to get you started, send me a PM and I'll undertake to sanitize the paper over the next few days.
Added link to article on fixed-point Goldschmidt Square Root Algorithm.