This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gfortran vs ifort


Girish Kulkarni wrote:
> Surprisingly, results with `ifort -O0` (v 10.1 on amd64) do not match
> with `gfortran -O0` (v 4.1.2 on amd64) for the code that I described
> earlier.

There might be a compiler problem, but more likely is an unstable algorithm.

> Moreover, results with `gfortran -O0` (v 4.1.2 on amd64) *do not
> match* with `gfortran -O0` (v 4.3.2-1.1 on i386).

One likely reason is the excess precision of the x87 math processor;
try -ffloat-store on i386.

Some literature references; GCC specific

http://gcc.gnu.org/wiki/x87note
http://gcc.gnu.org/wiki/FloatingPointMath
http://gcc.gnu.org/wiki/Math_Optimization_Flags

and general and really worth reading:

David Goldberg, What Every Computer Scientist Should Know About Floating-Point Arithmetic
http://www.google.de/search?q=Goldberg+What+Every+Computer+Scientist+Should+Know+About+Floating-Point+Arithmetic

David Monniaux, The pitfalls of verifying floating-point computations:
http://hal.archives-ouvertes.fr/hal-00128124

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]