From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <8dacce90101e291ed2e40acdf498a6e1.axp-list@archive.invalid> X-Archive-Original-Message-ID: <3.0.2.32.19971113130855.00932100@mail.vt.edu> Date: Thu, 13 Nov 1997 13:40:48 -0600 From: Wes Bauske Subject: Re: Perf. of F77 on Alpha Tom/David, Actually the divide may be as much trouble as the sqrt() function. Some tests I did indicate any Alpha divide (float/int) is slow. The table lookup for sqrt() is probably the fastest technique for an approximation. Maybe you could modify your code to move the divide/sqrt() out of the loop?? Can it be pre-computed and reused repeatedly? Maybe you can eliminate both the divide and sqrt() with a table lookup/interpolate?? That works if you "know" the range of values the code will use and you can tolerate the error in the calculations. Stuff I do can tolerate such errors if the table is reasonably finely sampled. Wes Tom Linden wrote: > > You don't want to write your own routine (reinvent the wheel) If you did, > the most efficient would be a table lookup for a seed to a Newton=Raphson > loop. But how are you going to inline it? with F77 this wont fit into an > arithmetic statement function, with C you could build macro, but this > is a regressive computing technique. Its the compiler! Find a copiler > that does the inlining. I haven't looked at it but I would bet that DEC > Fortran does this, I think they used to on the VAX. > > On Thu, 13 Nov 1997, David van der Spoel wrote: > > > Yes I have profiled my app, 80 % of the time is in one loop that has > > the sqrt, or actually 1/sqrt which the DEC F77 compiler recognizes > > and puts in a call to rsqrtf. However, the compiler should inline the > > code for the rsqrt and then pipeline my loop, which now it doesn't. > > > > So I will probably write F77 code for the 1/sqrt (I have C-code for it) > > unless I can find a smarter compiler > > > > Groeten, David. > > ________________________________________________________________________ > > Dr. David van der Spoel Biomedical center, Dept. of Biochemistry > > s-mail: Husargatan 3, Box 576, 75123 Uppsala, Sweden > > e-mail: spoel@xray.bmc.uu.se www: http://zorn.bmc.uu.se/~spoel > > phone: 46 18 471 4205 fax: 46 18 511 755 > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > > > > > -- > > To unsubscribe: send e-mail to axp-list-request@redhat.com with > > 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com > > > > > > -- > To unsubscribe: send e-mail to axp-list-request@redhat.com with > 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com -- Regards, Wes -- To unsubscribe: send e-mail to axp-list-request@redhat.com with 'unsubscribe' as the subject. Do not send it to axp-list@redhat.com