Fixed the error calculation. Now similar to MATLAB® and gnuplot.