From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Quick inverse square root Date: Mon, 4 Jan 2021 00:47:13 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <7fe2291a-bc12-4708-85aa-0ffbdc25b2bfn@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sun, 3 Jan 2021 23:47:13 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="7cdc3bd44ff416a4cea5959139455d8d"; logging-data="20999"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18do5XN9i42UPMcWt8TBuItJzoK1j4p1F4=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0 Cancel-Lock: sha1:1YtSFOVJIY2TDDGuJD6Ds0EvJds= In-Reply-To: <7fe2291a-bc12-4708-85aa-0ffbdc25b2bfn@googlegroups.com> Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:61021 List-Id: On 1/3/21 11:31 PM, Matt Borchers wrote: > > Thank you Jeff and Dmitry. I have a generic functioning now. Glad to have been of help. Regarding the unsigned type, it seems this only works if F'Size = 32 or 64, so you could write versions that use Unsigned_32 and Unsigned_64, and then make your generic function do if F'Size = 32 then return QISR32 (A); elsif F'Size = 64 then return QISR64 (A); else raise Program_Error with "F'Size must be 32 or 64"; end if; But I don't understand why this exists. In what way is it better than the (inverse) Sqrt operation of the FPU? -- Jeff Carter "I'm a kike, a yid, a heebie, a hook nose! I'm Kosher, Mum! I'm a Red Sea pedestrian, and proud of it!" Monty Python's Life of Brian 77