When -roundoff
>2, KAP performs reciprocal substitution
to move an expensive division outside a loop. In the following
example, since the variable R
is not changed in
the loop, the division can be replaced by multiplication by its
reciprocal, as follows:
DO 1 I=1,N A(I) = B(I)/R 1 CONTINUE
Becomes:
RR1=1.0/R DO 1 I=1,N A(I) = B(I)*RR1 1 CONTINUE
Copyright © Digital Equipment Corporation. 1997. All Rights Reserved.