I have some performance-critical code that will crash and burn in extremely unlikely situations (e.g. when an intermediate `double` equals `0.0`, when it is no more likely for that double to be zero than any other value).

One option of course is to whistle and ignore the corner case, and pray it never comes up. But I'd like to catch it if possible; on the other hand I'm not too enthusiastic about adding conditionals into performance-critical code. Are there any tricks to adding a check of the form

```
if(val == 0.0)
{
    // extremely unlikely code path
}

```

in a way that will minimize the performance penalty? On some compilers it's possible to pass the CPU branch-prediction hints, but I've heard that these no longer have any effect on modern processors?