## la cosiddetta 'error function'
erf <- function(x) 2 * pnorm(x * sqrt(2)) - 1
## e la 'complementary error function'
erfc <- function(x) 2 * pnorm(x * sqrt(2), lower = FALSE)
## le inverse:
erfinv <- function (x) qnorm((1 + x)/2)/sqrt(2)
erfcinv <- function (x) qnorm(x/2, lower = FALSE)/sqrt(2)
#
plot(erf,-5,5, ylim=c(-1,2), lwd=2 )
abline(v=axTicks(1), h=axTicks(2), col="blue",lty=3)
abline(v=0, h=0, col="blue",lty=2)
curve(erfc,add=TRUE,col="red", lwd=2)