PUBDEV-9: Port over 72245c8c: Catch numerical instability earlier.