Re: Automatically transform or expand do loop in a subroutine
- From: Tim Prince <tprince@xxxxxxxxxxxxxxxxxx>
- Date: Thu, 31 Jan 2008 14:03:31 GMT
Richard Maine wrote:
highegg <highegg@xxxxxxxxx> wrote:c = c + ishft(d*(d+l),-1) will be faster, with most compilers, in the
On Jan 31, 7:06 am, nos...@xxxxxxxxxxxxx (Richard Maine) wrote:
yaqi <yaqiw...@xxxxxxxxx> wrote:certainly not. c = c + d*(d+1)/2, more likely :)
I want to save computing time as much as I can....
do i=1,dThe "obvious" way to save a lot of computing time here is to replace the
c = c + i
end do
loop with
c = c + d*i
Um. Er. Right.
case l >= 0. Even in analogous cases, where there is information
implying that the expression need be valid only for positive operands,
compilers don't take advantage of it.
Perhaps i and l aren't good choices for newsgroup posts. It was
difficult enough to remove obvious mistakes from my response.
.
- Follow-Ups:
- Re: Automatically transform or expand do loop in a subroutine
- From: James Giles
- Re: Automatically transform or expand do loop in a subroutine
- References:
- Automatically transform or expand do loop in a subroutine
- From: yaqi
- Re: Automatically transform or expand do loop in a subroutine
- From: Richard Maine
- Re: Automatically transform or expand do loop in a subroutine
- From: highegg
- Re: Automatically transform or expand do loop in a subroutine
- From: Richard Maine
- Automatically transform or expand do loop in a subroutine
- Prev by Date: Fortran 2003: abstract interfaces
- Next by Date: computing Bernoulli numbers
- Previous by thread: Re: Automatically transform or expand do loop in a subroutine
- Next by thread: Re: Automatically transform or expand do loop in a subroutine
- Index(es):
Relevant Pages
|