
9 Oct
2011
9 Oct
'11
4:48 p.m.
AMDG On 10/09/2011 06:47 AM, Matwey V. Kornilov wrote:
I believe that there is a bug in eps_tolerance implementation. At line 34 of toms748_solve.hpp one can see:
return (fabs(a - b) / (std::min)(fabs(a), fabs(b))) <= eps;
When both a and b equal zero this condition is evaluated to a false instead of a true. Left hand of condition is NaN and the right one is a floating- point number hence the result is false.
Well obviously, a user wants to see true here because the relative length of interval in this case tend to zero.
What exactly do you mean by "the relative length of the interval tends to zero?" lim_{(a,b)->(0,0)} |a-b| / min(|a|, |b|) doesn't exist. In Christ, Steven Watanabe