program to calculate RMS error