# /* vim: set filetype=awk : */ -*- awk -*- BEGIN { Got = 1; Want = 2; Logs = 0; Ee = 848456353 / 312129649; Pred = 30; Inc = 0; OFS=FS="," } { sub(/#.*/,"") } /^[ \t]*$/ { next } NF==2 { N++; Predicted = Logs ? Ee^$Want : $Want; Actual = Logs ? Ee^$Got : $Got; Re = 100*(Predicted - Actual)/Actual; MRe = Re < 0 ? -1*Re : Re; SumMre += MRe; if (MRe <= Pred) PredN++ if (Inc) print N,MRe, (MRe <= Pred),PredN } END { if (!Inc) print SumMre/N,100*PredN/N }