Arithmetic Reordering Optimizations

If you use the /assume:noaccuracy_sensitive option, Compaq Visual Fortran may reorder code (based on algebraic identities) to improve performance. For example, the following expressions are mathematically equivalent but may not compute the same value using finite precision arithmetic:

  X = (A + B) + C

  X = A + (B + C)

The results can be slightly different from the default /assume:accuracy_sensitive because of the way intermediate results are rounded. However, the /assume:noaccuracy_sensitive results are not categorically less accurate than those gained by the default. In fact, dot-product summations using /assume:noaccuracy_sensitive can produce more accurate results than those using /assume:accuracy_sensitive.

The effect of /assume:noaccuracy_sensitive is important when Compaq Fortran hoists divide operations out of a loop. If /assume:noaccuracy_sensitive is in effect, the unoptimized loop becomes the optimized loop:

Unoptimized Code   Optimized Code
  DO I=1,N
  .
  .
  .
  B(I)= A(I)/V
  END DO
   T= 1/V
   DO I=1,N 
   .
   .
   .
   B(I)= A(I)*T
   END DO 

The transformation in the optimized loop increases performance significantly, and loses little or no accuracy. However, it does have the potential for raising overflow or underflow arithmetic exceptions.