x - \frac{y}{1 + \frac{x \cdot y}{2}}\begin{array}{l}
\mathbf{if}\;x \le -2.52295109951887609 \cdot 10^{-17} \lor \neg \left(x \le 6.68360706888572707 \cdot 10^{-37}\right):\\
\;\;\;\;x - \frac{2}{x}\\
\mathbf{else}:\\
\;\;\;\;x - \left(\frac{y}{\left(-{\left(\frac{x \cdot y}{2}\right)}^{3} \cdot \frac{x \cdot y}{2}\right) + {1}^{4}} \cdot \left(1 \cdot 1 + \frac{x \cdot y}{2} \cdot \frac{x \cdot y}{2}\right)\right) \cdot \left(1 - \frac{x \cdot y}{2}\right)\\
\end{array}double code(double x, double y) {
return (x - (y / (1.0 + ((x * y) / 2.0))));
}
double code(double x, double y) {
double VAR;
if (((x <= -2.522951099518876e-17) || !(x <= 6.683607068885727e-37))) {
VAR = (x - (2.0 / x));
} else {
VAR = (x - (((y / (-(pow(((x * y) / 2.0), 3.0) * ((x * y) / 2.0)) + pow(1.0, 4.0))) * ((1.0 * 1.0) + (((x * y) / 2.0) * ((x * y) / 2.0)))) * (1.0 - ((x * y) / 2.0))));
}
return VAR;
}



Bits error versus x



Bits error versus y
Results
if x < -2.522951099518876e-17 or 6.683607068885727e-37 < x Initial program 0.0
Taylor expanded around inf 3.0
Simplified3.0
if -2.522951099518876e-17 < x < 6.683607068885727e-37Initial program 0.1
rmApplied flip-+3.0
Applied associate-/r/3.1
rmApplied flip--8.1
Applied associate-/r/8.2
Simplified8.2
Final simplification5.3
herbie shell --seed 2020078
(FPCore (x y)
:name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, B"
:precision binary64
(- x (/ y (+ 1 (/ (* x y) 2)))))