Break the formula down into multiple computations and verify that every divisor is not 0. My guess is that you are hitting a divide by 0 error in your code due to rounding/underflow.
The problem is implementation dependent because it does not fail on x86_64 Linux with GCC 4.3. What platform/compiler are you using?