diff --git a/src/compute_state.cc b/src/compute_state.cc index 415ed209de60fccb5c904ead060b8570596ef9ad..b2ef883b1012a3fd17b49ddc128b80a6b56a3add 100644 --- a/src/compute_state.cc +++ b/src/compute_state.cc @@ -49,8 +49,15 @@ double state_update_dieterich_bisection(double h, double uol, double state_update_dieterich(double h, double uol, // unorm / L double old_state) { - double const ret1 = state_update_dieterich_bisection(h, uol, old_state); - assert(std::abs(ret1 - old_state + uol - h * std::exp(-ret1)) < 1e-12); + double const ret = state_update_dieterich_bisection(h, uol, old_state); + /* We have - return ret1; + ret - old_state + uol = h*exp(-ret) + + or + + log((ret - old_state + uol)/h) = -ret + */ + assert(std::abs(std::log((ret - old_state + uol) / h) + ret) < 1e-13); + return ret; }