diff --git a/src/compute_state.cc b/src/compute_state.cc index 5afb2c445f887a414626a460645a08173e16a8ac..2ff511c2c294455dffe3d8d7717ebc6537e79a84 100644 --- a/src/compute_state.cc +++ b/src/compute_state.cc @@ -57,6 +57,8 @@ double state_update_dieterich(double h, double uol, double old_state) { log((ret - old_state + uol)/h) = -ret */ - assert(std::abs(std::log((ret - old_state + uol) / h) + ret) < 1e-13); + assert(std::min(std::abs(ret - old_state + uol - h * std::exp(-ret)), + std::abs(std::log((ret - old_state + uol) / h) + ret)) < + 1e-12); return ret; }