#!/usr/bin/awk -f
function fabs(x)
{
if (x < 0)
return -x;
return x;
}
BEGIN {
lines = 0;
error = 0;
pi = 3.14159265358979323846;
avg = sqrt(2 / pi);
}
NF == 6 {
if ($2 >= 10.0) {
#printf "OK: %s\n", $0;
error += fabs($6 - avg);
lines++;
}
next;
}
#// {
# print;
# next;
#}
END {
gsub(/^.*N=/, "", FILENAME);
gsub(/\.dat$/, "", FILENAME);
printf "%s %g\n", FILENAME, error / (lines * avg);
}
# vim: cindent
Platon Group <platon@platon.org> http://platon.org/
|