Closed shadisharba closed 5 years ago
What happens when we use a relative tolerance at values of 0.5 or similar? At which point is it sensible to switch from a relative to an absolute tolerance?
I don't think that there's a limit, it'll always be problem dependent. In the case I tried, absolute tolerance of 0.01 worked fine but I thought of making it general by not dividing on any number smaller than one which means not causing the relative tolerance to be bigger than the absolute one.
Sounds good to me. Thanks!
This PR modifies the approximate equality function to use
boost::math::relative_difference
from https://www.boost.org/doc/libs/1_67_0/libs/math/doc/html/math_toolkit/float_comparison.html in addition to an absolute tolerance similar to https://www.python.org/dev/peps/pep-0485/ that can be used when comparing numbers close to zero.In
static_matrix
, when the norm of the displacement or the forces is less than one, then no relative tolerance is used. What do you think?