Non-determinism of a floating point processor?

Without going into unnecessary data, is it possible for operations with floating point numbers (x86_64) to be returned - despite slight variations in their results based on identical input data? Is even one bit different?

I mimic a mostly chaotic system, and I expect that small changes in the data will have visible effects. However, I expected that with the same data the behavior of the program will be fixed. This is not the case. I get visible but acceptable differences with every run of the program.

I think I left some kind of variable uninitialized somewhere ...

I use C ++ and Python.

ANSWER

Russell's answer is correct. Floating point operations are deterministic. Non-determinism was caused by a dangling pointer.

+5
source share
2 answers

Contra Thomas answer, floating point operations are not non-deterministic. They are devilishly thin, but this program should give the same results for the same inputs if it does not use uninitialized memory or intentionally randomized data.

My first question is: what do you mean by "same data"? How does this data get into your program?

+4
source

Yes it is possible. Quote from C ++ FAQ :

, cos (x)!= cos (y), x == y. ; , : - . ( , , .)

?

[F] , , , . , , sizeof (double), , , .

+5

All Articles