@Thaddy
I just noticed your use of NaN return values. I'd have to do some testing, but I seem to get inconsistent results across platforms. It seems code that I develop on a Mac can crash on Windows when NaNs are generated, Windows seems less robust. I've not thoroughly investigated, but noticed some odd behavior. Perhaps you, or someone else, has more information?
EDIT: Normally I code on Mac, then when problems occur on Win go back and find whatever may be the problem, divide by zero or whatever, and correct the code for that.