Re: c vs java floating point errors under windows XP
From: Dan Tex1 (dantex1_at_aol.com)
Date: 06/12/04
- Next message: Bill Godfrey: "Re: OT - Software engineering guild?"
- Previous message: AngleWyrm: "Re: Need comments and ideas about an hypothetic project"
- In reply to: valis: "c vs java floating point errors under windows XP"
- Next in thread: ak: "Re: c vs java floating point errors under windows XP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 11 Jun 2004 23:57:45 GMT
>From: howe.charles@mayo.edu (valis)
>Date: 6/11/2004 11:50 AM Pacific Daylight Time
>Message-id: <a194ebe7.0406111050.574c920d@posting.google.com>
>
>I have an application that requires between 10^12 and 10^15 iterations
>of a floating point calculation. The precision of the numbers must be
>at least 20 digits for the math to work out. I have written an
>algorithm in java and in C to accomplish this calculation. Under
>Linux, both algorithms appear to work fine, and the accumulated error
>does not impact on the outcome. However, in Windows, the java
>algorithm seems to run fine but the C calculation (compiled with gcc
>under MinGW) suffers from extreme error that renders the calculation
>completely useless. Can anyone explain to me what the difference might
>be between the java code (compiled under jdk1.3.1_03) and the C code
>in terms of the floating point calculations? Also, what is the
>difference between running the calculation on Linux vs WinXP? The
>reason I cannot simply use the java algorithm is that the large number
>of iterations takes several days in java, but only several hours in C.
>
>Thanx.
Different computers.
Different compilers ( for each platform ).
Differnt operating systems.
Different CPU's ??
Extended precision floating point.
The possible reasons for your results are almost endless.
Are you "SURE" that you know what the correct results should be?
Getting the same answer under Linux for your C and your Java version doesn't
necessarily mean that your results are correct or that you don't have bugs in
one of both implementations.
How bout non-standard language usage. This can causes differences between
compilers and platforms. And of course.... I've found that even other
software loaded on your computer can cause problems of a nature that you would
"swear" are impossible.
Just out of curiosity ( ie.. no flame intended here )... how hard would it be
to create a fortran version of your algorithm. I'd be interested to see how a
fortran version compared speed wise.
Dan :-)
- Next message: Bill Godfrey: "Re: OT - Software engineering guild?"
- Previous message: AngleWyrm: "Re: Need comments and ideas about an hypothetic project"
- In reply to: valis: "c vs java floating point errors under windows XP"
- Next in thread: ak: "Re: c vs java floating point errors under windows XP"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|