erf function
Calculates the error function.
Implementation
double erf(double x) {
if (x == 0) {
return 0;
}
if (double.infinity == x) {
return 1;
}
if (double.negativeInfinity == x) {
return -1;
}
if (double.nan.compareTo(x) == 0) {
return double.nan;
}
return _erfImp(x, false);
}