Plot the
error-function
together with several of its
tabulated values (as a test). Try to reproduce the plot from the
Wikipedia article. Use svg terminal.
The error-function can be approximated like this,
public static double erf(double x){
/// single precision error function (Abramowitz and Stegun, from Wikipedia)
if(x<0) return -erf(-x);
double[] a={0.254829592,-0.284496736,1.421413741,-1.453152027,1.061405429};
double t=1/(1+0.3275911*x);
double sum=t*(a[0]+t*(a[1]+t*(a[2]+t*(a[3]+t*a[4]))));/* the right thing */
return 1-sum*Exp(-x*x);
}