I’m running a C++ optimization program in a win32 environment. The program uses pre-built DLL’s for FFTW and pthreads.
Recently, the program was changed in a way that it can encounter very large numbers and possibly infinity. After this change, this otherwise lean and robust system started to produce strange symptoms – most notably it produced different numerical results on different runs (on the same computer, with the same binary), and even adding a printf or a dummy allocation here and there changed behaviour radically.
I double checked every possible buffer overrun, memory allocations, threading issues (I now reduced the thread pool size to 1), stack size, but after weeks of searching, I found nothing. Before the change, the program had no non-determinism or stability issues, it regularly run for days.
I wonder if the problem could lie in the FFTW module? Or can such floating-point instability stem from large numbers?
Floating point numbers themselves won’t cause non-determinism but any third party libraries you may be using may do so if they’re buggy, such as not handling infinities correctly.
You may also want to consider the possibility that your own code may be the culprit. That’s usually (though not always) the case when the third-party library is heavily used since it’s not out of the range of imagination to assume that most bugs would already have been found by someone else.
Whether FFTW lies within that category, I don’t know. But it’s certainly possible it may have been tested by more people than your own code 🙂