The function: $p = \dfrac{\mathrm{erf}(z)-\mathrm{erf}(f(x))}{\mathrm{erf}(z)-\mathrm{erf}(y)}$
All the parameters of the error function ($z, y, f(x)$) are very large. This leads to catastrophic cancellation when I tried to solve it. I fix it by using either Mathematics two parameters Erf implementation or using the complementary error function. However, I would like to have a nice and fast approximation for $p$ using only elementary functions.
As $p$ is a probability, it is important that $0 \le p \le 1$. I do not need a great precision on $p$ only on the order of $10^{-3}$.
Now, the real problematic question is next. $x$ is a random variable with an Uniform Distribution between $a$ and $b$. I want to know the expected $p$, and for that I'm using
$\int_{a}^{b} \dfrac{p(x)}{b-a} dx$
Now, because the function $f(x)$ is inside an error function, I was never able to get a solution for this integral. My first question exist exactly to go is that direction. Is there any other strategy?