x - \frac{y}{1 + \frac{x \cdot y}{2}}\begin{array}{l}
\mathbf{if}\;x \le -2.84327720202764277 \cdot 10^{-17} \lor \neg \left(x \le 0.0897259723817682847\right):\\
\;\;\;\;x - \frac{2}{x}\\
\mathbf{else}:\\
\;\;\;\;x - \left(\frac{1}{1 + \frac{x \cdot y}{2}} \cdot \frac{y}{1 - \frac{x \cdot y}{2}}\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.843277202027643e-17) || !(x <= 0.08972597238176828))) {
VAR = (x - (2.0 / x));
} else {
VAR = (x - (((1.0 / (1.0 + ((x * y) / 2.0))) * (y / (1.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.843277202027643e-17 or 0.08972597238176828 < x Initial program 0.0
Taylor expanded around inf 1.3
Simplified1.3
if -2.843277202027643e-17 < x < 0.08972597238176828Initial program 0.1
rmApplied flip-+3.7
Applied associate-/r/3.7
rmApplied difference-of-squares3.7
Applied *-un-lft-identity3.7
Applied times-frac0.1
Final simplification0.7
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)))))