Re: Square root algorithms and complexity
- From: LC Killingbeck <NOTlynn.killingbeck@xxxxxxxxxxxxxxxx>
- Date: Sat, 26 Nov 2005 01:53:22 GMT
"gpapak" <gpapak@xxxxxxxxxxx> wrote in
news:dm70gf$79a$1@xxxxxxxxxxxxxxxxxxxx:
> Dear Lynn,
>
>
> I developed an algorithm which includes multiplications,addistions,
> and the computation of a square root .
> I want to extract the complexity of my algorithm, in terms of the
> number of multiplications that the algorithm performs, in order to
> compare it with other
> similar algorithms (time consumption).
>
>
> best regards
> George
>
> "gpapak" <gpapak@xxxxxxxxxxx> wrote in message
> news:dm6tsc$6lc$1@xxxxxxxxxxxxxxxxxxxxxxx
>> Hello,
>>
>>
>> Does anyone know popular algorithms for computing the square root of
> integer
>> numbers?
>> Additionly, which is the number of multiplications that is needed for
>> computing the square root using a specified algorithm ?
>>
>> Thanks in advance
>> George
>>
>>
>>
>
>
Well, the last timing information I have is for the Intel 80486, with a
1991 copyright date. A FSQRT took around 85 cycles; a FMUL around 16. So,
a square root would have taken about 5-6 times a long as a multiply.
Newer chips have much improved FPU times (at least for a multiply). The
85:16 ratio is near the 5.5 ratio mentioned by Herman Rubin for high-
precision arithmetic. Could well just be a coincidence! Probably is! If
you can't find anything better (e.g., measure the times in your actual
program on your actual chip), just use that ratio. Unless you have a
tremendously high number of SQRT() per second, any error is probably
what I know as "fine tuning the noise".
I'll repeat, that the actual square root algorithm almost surely does not
use any multiplies or divides at the chip level, but rather some variant
of non-restoring square root algorithm. Only if you are going beyond the
native accuracy of the machine itself, will actual multiplications be
needed (e.g., Newton's reciprocal square root) at a software level.
I can't really tell where you are headed. Hope some of this helps!
Lynn Killingbeck
.
- Follow-Ups:
- Re: Square root algorithms and complexity
- From: Don Taylor
- Re: Square root algorithms and complexity
- References:
- Square root algorithms and complexity
- From: gpapak
- Re: Square root algorithms and complexity
- From: gpapak
- Square root algorithms and complexity
- Prev by Date: Re: 1/0
- Next by Date: Help me about this min result resolve method.
- Previous by thread: Re: Square root algorithms and complexity
- Next by thread: Re: Square root algorithms and complexity
- Index(es):
Relevant Pages
|