From 492b24c8b636376db8863489589e491e1a639e7c Mon Sep 17 00:00:00 2001 From: Elias Pipping <elias.pipping@fu-berlin.de> Date: Thu, 16 Aug 2012 13:41:27 +0200 Subject: [PATCH] Use a less scale-dependent assertion --- src/compute_state.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/compute_state.cc b/src/compute_state.cc index 5afb2c44..2ff511c2 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; } -- GitLab