How Accurate and Precise is libm.a?
Chad asks: "I am looking into doing so molecular modeling on Linux platforms because they are cost effective. After running some tests, I find errors, albeit small, in the results as compared to similar tests on SGIs or SUNs. I have heard about this in the past when talking to some professors but I never thought much about it until now. Knowing that errors propagate and grow (especially after weeks of computation), I want to know what I can do to avoid problems with the math library. Is it a problem? Can it be fixed? Am I over reacting?" Can anyone offer up some information on this? Has anyone actually stressed tested libm.a?
At my company we develop some sort of tool, and we build Linux and Solaris versions. The nature of the tool is that it does a lot of floating point number crunching, and we'd like it if the Linux and Solaris versions give the same output for the same input. Unfortunately, there are discrepencies between the floating point operations, and we have to do rather crude workarounds to try to suppress this tendency. In debugging, I've noticed that the discrepencies between the two systems often amount to multiples of seven times the smallest floating point number (with a given exponential term). For many purposes, this is OK, but if your program is basing decisions on the values of floating point numbers, you could easily go one way on Linux and the other on Solaris.
What's really interesting is something I noticed... When I would do "something", evaluate a cost function, and then undo that "something" (because of an increase in cost), the cost function after the undo would be equal to the original cost function (before the "something") more often on Linux than on Solaris.
Again, I don't really know what all contributes to the FP operations, so it may be more dependent on hardware than the libs.
-- $SIGNATURE