upon invalid probability, throw a C++ exception instead of sending a bunch of warnings to stderr