Saner tolerances & stricter LRE test.
NIST recommends greater than 4 digits rather than greater than
or equal to 4 digits to declare that the solve was successful.
Change-Id: I5c65e6e791508b95b692c23dafd3833d73cd0487
diff --git a/examples/nist.cc b/examples/nist.cc
index f7bd38e..4b640fe 100644
--- a/examples/nist.cc
+++ b/examples/nist.cc
@@ -510,7 +510,7 @@
}
const int kMinNumMatchingDigits = 4;
- if (log_relative_error >= kMinNumMatchingDigits) {
+ if (log_relative_error > kMinNumMatchingDigits) {
++num_success;
}
@@ -560,9 +560,9 @@
FLAGS_max_line_search_restarts;
options->use_approximate_eigenvalue_bfgs_scaling =
FLAGS_approximate_eigenvalue_bfgs_scaling;
- options->function_tolerance = 1e-18;
- options->gradient_tolerance = 1e-18;
- options->parameter_tolerance = 1e-18;
+ options->function_tolerance = std::numeric_limits<double>::epsilon();
+ options->gradient_tolerance = std::numeric_limits<double>::epsilon();
+ options->parameter_tolerance = std::numeric_limits<double>::epsilon();
}
void SolveNISTProblems() {