HP Fortran question: precision of double-precision?
Author Message
HP Fortran question: precision of double-precision?

[ Please note the Reply-To; I'm posting this for a friend ... ]

--------begin included text------------------------------------------
In a fortran application program under HPUX 9.01, we have an
iteration loop that needs to converge to very tight tolerances.
The independent variable is of the order of 30 and the convergence
criteria needs to be about 1.D-11.  The whole program has
declared all floating point variables to be double precision so,
according to the HP Fortran manual, we should get over 15 significant
figures of accuracy.  In checking this loop, however, it looks like
we're converging to about 9 significant digits and the remaining
6 are junk.  As expected, the loop frequently does not converge.

So the questions are: Are we doing something wrong?  Is HP Fortran
doing something wrong (it happens both with -O and -g turned on, so
it doesn't seem to be sensitive to optimization)?  How can we find
out what's going on?  Other pertinent information - we have both
the -K and +T switches turned on.

Thanks.

Bill Steer
--------end included text------------------------------------------

Thank you.
- Chuck
--

Tue, 03 Sep 1996 00:46:42 GMT
HP Fortran question: precision of double-precision?

Quote:
>--------begin included text------------------------------------------
>In a Fortran application program under HPUX 9.01, we have an
>iteration loop that needs to converge to very tight tolerances.
>The independent variable is of the order of 30 and the convergence
>criteria needs to be about 1.D-11.  The whole program has
>declared all floating point variables to be double precision so,
>according to the HP Fortran manual, we should get over 15 significant
>figures of accuracy.  In checking this loop, however, it looks like
>we're converging to about 9 significant digits and the remaining
>6 are junk.  As expected, the loop frequently does not converge.

[...]

My first suspicion would be that you are being bitten by roundoff error,
either by unlucky combination of terms or for a mathematical reason.
Don't forget, for example, that if you look for a quadratic minimum, the
best relative accuracy you can hope for is 1+sqrt(eps), where 1+eps is
the smallest number > 1 which can stil be represented on your machine.
--

The joy of engineering is to find a straight line on a double
logarithmic diagram.

Tue, 03 Sep 1996 17:40:22 GMT

 Page 1 of 1 [ 2 post ]

Relevant Pages