What is the probability of Igor provinding a wrong result?

This may be a silly question, but how often will Igor provide a wrong result?
For instance, I wrote an example "for" loop at the bottom of this post:

Of course, the output of this function should always print "true" but is there a possibility that Igor would ever return "false". For instance, a logic gate failure for instance? If so, what is the frequency that Igor would provide a wrong output.

variable i=0
For(i=0;i<inf;i+=1)
if(i==i)
print "true"
else
print "false"
endif
endfor
end
So you are asking if a computer can get it wrong on occasion (not really restricted to Igor I guess)? There are some articles on this on the web, but for a start the wiki article might be of interest: https://en.wikipedia.org/wiki/Soft_error
I guess it can be safely said that it is pretty impossible to encounter a "false" when your run the above code (which requires that you get a corruption exactly in the comparison part at the execution time), unless Igor has some bug when running such a loop forever.
The probability is so small that you should always treat such an occurrence as a bug in either your code or ours. You can guess which I will suspect when you report it to us :)

And in this case, such bugs are most likely to be caused by misunderstanding of how floating-point arithmetic works. For instance, i will never actually reach inf, ever. It will simply stop increasing after a (very long) while. That's because the limited resolution of a double-precision floating-point number will result in a situation where i will be so large that adding 1 doesn't change the value- the least significant bit of the mantissa will be larger than 1.

If you suspect that a gamma ray has twiddled one of your bits, causing a failure, just run the code three times. Such an event will happen twice with such vanishingly small probability that you will not see it happen twice.

John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
Hey John,
It would be so convenient to always blame my non-working code on a stray alpha/gamma ray instead on my poorly written code :)
However, assuming I am not exposed to any increased exposure to radiation beyond background and the only shielding is what comes available on my commonly manufactured laptop, what would be the frequency of Igor failing with just basic arithmetic operations. Like, should I expect 1 error in calculations over 1E20 operations?

austenld wrote:
Like, should I expect 1 error in calculations over 1E20 operations?


If I were an experimentalist I'd recommend that you try it -- run an infinite loop with a proper counter and have it record the error. Please report back to us after you have recorded a sufficient number of events for meaningful statistical analysis.

As I am not an experimentalist I'd suggest that one should always assume that any answer returned by a computer has a finite probability of being wrong. If you are a fan of statistics you can try to model the various sources of possible errors but I think you will find that the probability that an error is due to anything but some programmer (you, programmer who wrote the software you use, the people who wrote the OS or the people who wrote the code burned into your CPU) is orders of magnitude greater than due to a cosmic ray affecting your calculation.

A.G.
Hey A.G.

An infinite loop is currently running and I plan to keep it running overnight. If it is still running in the morning, I may put my laptop near my smoke detector to speed up this process.

Thanks for your suggestion,
Depending on the system you are running, there might be error correction mechanism spoiling your result.
Try the tool from
http://www.memtest86.com/
It does basically the same: writing something defined to memory, read it back and compare it to what it should be (like your routine). It also provides information about errors AND, as a big benefit, you checked your memory!
From my time working in a (small) computer shop I can tell you some expected results. If a memory bar is broken, it will usually report errors within one minute. A standard QA test included running memtest over night for each new PC (I would say between 500 and 1000 pieces). There was not a single computer failing this test, if it made it through the first 10 minutes.
Long story short: From personal experience, I will not expect an error within 20000 hours of testing.

HJ