Web lists-archives.com

[Mingw-users] [OT] comparing floating point results of different compilers (was: msvcrt printf bug)




Emanuel Falkenauer writes:

> Now to debug in Embarcadero a problem found in a MinGW build, we must
> be sure that the two versions behave exactly the same, and it's anyway
> a good QC practice to make sure that that is indeed the case. In order
> to do that, we have developed a whole tracing system where one version
> writes the details of its progress into a log and the other version
> then reads it to spot any differences in behavior. The system already
> saved us years in debugging... but floats have always been a problem:
> Embarcadero and MinGW don't (s)print(f) them the same! The last digit
> in the log is different so often, that many times the logging becomes
> largely useless: millions of BOGUS differences show up.  Usually we
> resign ourselves to use sprintf("%.4f",...) or such, and skip by hand
> what are clearly bogus "differences" remaining - but that always
> leaves the uncertainty that the differences COULD actually be real,
> i.e. that the exact float values are really different in the two
> builds.

Honest question: how can you compare the outputs of a program compiled
by two different compilers?  How can you make sure that all the
computations are carried in the same order?  That cannot be done even
when using different optimization flags on the same compiler.

Are you by chance comparing the result of an iterative process that
should converge to a final value?

-- 
Alberto


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
MinGW-users mailing list
MinGW-users@xxxxxxxxxxxxxxxxxxxxx

This list observes the Etiquette found at 
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.sourceforge.net/lists/listinfo/mingw-users
Also: mailto:mingw-users-request@xxxxxxxxxxxxxxxxxxxxx?subject=unsubscribe