519 |
#include <math.h> |
#include <math.h> |
520 |
int main( int argc, char** argv ) { |
int main( int argc, char** argv ) { |
521 |
int linnum,best,lncnt; |
int linnum,best,lncnt; |
522 |
double a,b,diff; |
double a,b,abave,relerr; |
523 |
best = -16; |
best = -16; |
524 |
lncnt = 0; |
lncnt = 0; |
525 |
while( 1 & (lncnt+=1) < 999 ) { |
while( 1 & (lncnt+=1) < 999 ) { |
526 |
scanf("%d", &linnum); |
scanf("%d", &linnum); |
527 |
if (linnum == -1) break; |
if (linnum == -1) break; |
528 |
scanf("%lf", &a); scanf("%lf", &b); |
scanf("%lf", &a); scanf("%lf", &b); |
529 |
diff = 0.5*(fabs(a)+fabs(b)); |
abave = 0.5*(fabs(a)+fabs(b)); |
530 |
if (diff > 0.0) { |
if (abave > 0.0) { |
531 |
diff=fabs(a-b)/diff; |
relerr=fabs(a-b)/abave; |
532 |
if (diff > 1.e-12) { |
if (relerr > 0.0) { |
533 |
linnum = (int)log10(diff); |
linnum = (int)log10(relerr); |
534 |
best = (best > linnum) ? best : linnum; |
best = (best > linnum) ? best : linnum; |
535 |
} |
} |
536 |
else { |
} |
537 |
if (best == -16 && diff != 0) best = -22; |
else { |
538 |
} |
if (best == -16 && abave != 0) best = -22; |
539 |
} |
} |
540 |
} |
} |
541 |
if (lncnt == 999) best=-29; |
if (lncnt == 999) best=-29; |
881 |
fout= |
fout= |
882 |
if test "x$ADM" = x ; then |
if test "x$ADM" = x ; then |
883 |
fout=$dir"/results/output.txt" |
fout=$dir"/results/output.txt" |
|
check_for_add_mon_output $fout |
|
884 |
else |
else |
885 |
fout=$dir"/results_ad/output.txt_adm" |
fout=$dir"/results_ad/output.txt_adm" |
886 |
fi |
fi |
888 |
echo "can't read \"$fout\" -- skipping $dir" |
echo "can't read \"$fout\" -- skipping $dir" |
889 |
continue |
continue |
890 |
fi |
fi |
891 |
|
if test "x$ADM" = x ; then |
892 |
|
check_for_add_mon_output $fout |
893 |
|
fi |
894 |
|
|
895 |
# Check for additional types of monitor output |
# Check for additional types of monitor output |
896 |
|
|