sin(x) different debug&release-results 
Author Message
 sin(x) different debug&release-results

Hallo Fellows,
did somebody else experience different double-precision-results in the
trigonometric functions (sin, cos) for the debug and release version of a vc++
6.0 compiled programm.
Well I did, and with the log-function as well.
Why is this so, and does somebody know a workaraound or better still is this
problem history in the new vc++ 7.0?
Hopefully yours, Mic.


Fri, 25 Jul 2003 20:27:30 GMT  
 sin(x) different debug&release-results
hmm Could you post a sample code showing that (specify switches)?

--

Andrea Ferro

---------
Brainbench C++ Master. Scored higher than 97% of previous takers
Scores: Overall 4.46, Conceptual 5.0, Problem-Solving 5.0
More info http://www.brainbench.com/transcript.jsp?pid=2522556


Hallo Fellows,
did somebody else experience different double-precision-results in the
trigonometric functions (sin, cos) for the debug and release version of a vc++
6.0 compiled programm.
Well I did, and with the log-function as well.
Why is this so, and does somebody know a workaraound or better still is this
problem history in the new vc++ 7.0?
Hopefully yours, Mic.



Fri, 25 Jul 2003 21:10:40 GMT  
 sin(x) different debug&release-results
different double-precision-results in the trigonometric functions "sin"

here is some example code:

int main (int argc, char **argv)
{
        long i;
        double x=0.89152,y;

        for (i=0; i < 10000; i++) {
                y=x+i/1000.0;
                fprintf(stderr,"sin(%7.5f)=%30.20f\n",y,sin(y));
        }
        return 0;

Quote:
}

you'll find many, many differences
the first for y=0.96252
sin(0.96252)=        0.82063423604053598000 (debug)
sin(0.96252)=        0.82063423604053609000 (release)

the next for y=1.03452
sin(1.03452)=        0.85961720497862504000 (debug)
sin(1.03452)=        0.85961720497862515000 (release)
and so on, and so on

well, which value is correct now?
the mathematical co-processor (release) or the math-library
(debug) or something else?



Fri, 25 Jul 2003 21:28:22 GMT  
 sin(x) different debug&release-results
different double-precision-results in the trigonometric functions "sin"

here is some example code:

int main (int argc, char **argv)
{
        long i;
        double x=0.89152,y;

        for (i=0; i < 10000; i++) {
                y=x+i/1000.0;
                fprintf(stderr,"sin(%7.5f)=%30.20f\n",y,sin(y));
        }
        return 0;

Quote:
}

you'll find many, many differences
the first for y=0.96252
sin(0.96252)=        0.82063423604053598000 (debug)
sin(0.96252)=        0.82063423604053609000 (release)

the next for y=1.03452
sin(1.03452)=        0.85961720497862504000 (debug)
sin(1.03452)=        0.85961720497862515000 (release)
and so on, and so on

well, which value is correct now?
the mathematical co-processor (release) or the math-library
(debug) or something else?



Fri, 25 Jul 2003 21:28:14 GMT  
 sin(x) different debug&release-results
hmm Could you post a sample code showing that (specify switches)?

Sample code:
Please see my own "reply" from Feb. 5 2001 5:28 AM.

Thanks, Mic.



Fri, 25 Jul 2003 22:38:57 GMT  
 sin(x) different debug&release-results

Quote:
> different double-precision-results in the trigonometric functions "sin"

> here is some example code:

> int main (int argc, char **argv)
> {
> long i;
> double x=0.89152,y;

> for (i=0; i < 10000; i++) {
> y=x+i/1000.0;
> fprintf(stderr,"sin(%7.5f)=%30.20f\n",y,sin(y));
> }
> return 0;
> }

> you'll find many, many differences
> the first for y=0.96252
> sin(0.96252)=        0.82063423604053598000 (debug)
> sin(0.96252)=        0.82063423604053609000 (release)

> the next for y=1.03452
> sin(1.03452)=        0.85961720497862504000 (debug)
> sin(1.03452)=        0.85961720497862515000 (release)
> and so on, and so on

> well, which value is correct now?
> the mathematical co-processor (release) or the math-library
> (debug) or something else?

Sorry mic but the answer is that they are both right.
Doubles only have a precision of about 14 decimal digits so there is nothing
wrong when you see a difference in the 16th significant digit.


Fri, 25 Jul 2003 23:52:51 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. different results between Debug/Release builds

2. different debug-release results

3. results are different in debug and release

4. Different results between Debug and Release

5. Different results between Print & Print Preview

6. Results can change between Debug and Release mode?

7. Debug & RElease versions of 5.0 produce DIFFERENT results!

8. ATL7 / different OSs == different results

9. Structure is different in debug/release

10. Different execution between Release and Debug version

11. Different results of OpenSchema() with different drivers?

12. Structure is different in debug/release

 

 
Powered by phpBB® Forum Software