static int verbose;
static int output_max_error; /* Should the maximal errors printed? */
static int output_points; /* Should the single function results printed? */
+static int ignore_max_ulp; /* Should we ignore max_ulp? */
static FLOAT minus_zero, plus_zero;
static FLOAT plus_infty, minus_infty, nan_value;
{
int ok = 0;
- if (max_error <= allowed)
+ if (max_error == 0.0 || (max_error <= allowed && !ignore_max_ulp))
{
ok = 1;
}
&& (computed == 0.0 && expected == 0.0
&& signbit(computed) != signbit (expected)))
ok = 0;
- else if (ulp <= max_ulp)
+ else if (ulp == 0.0 || (ulp <= max_ulp && !ignore_max_ulp))
ok = 1;
else
{
"Don't output maximal errors of functions"},
{ "no-points", 'p', NULL, 0,
"Don't output results of functions invocations"},
+ { "ignore-max-ulp", 'i', "yes/no", 0,
+ "Ignore given maximal errors"},
{ NULL, 0, NULL, 0, NULL }
};
case 'f':
output_max_error = 0;
break;
+ case 'i':
+ if (strcmp (arg, "yes") == 0)
+ ignore_max_ulp = 1;
+ else if (strcmp (arg, "no") == 0)
+ ignore_max_ulp = 0;
+ break;
case 'p':
output_points = 0;
break;
output_ulps = 0;
output_max_error = 1;
output_points = 1;
-
+ /* XXX set to 0 for releases. */
+ ignore_max_ulp = 0;
+
/* Parse and process arguments. */
argp_parse (&argp, argc, argv, 0, &remaining, NULL);