Average Error: 0.0 → 0.1
Time: 3.1s
Precision: 64
\[x - \frac{y}{1 + \frac{x \cdot y}{2}}\]
\[x - \frac{1}{\frac{1 + \frac{x \cdot y}{2}}{y}}\]
x - \frac{y}{1 + \frac{x \cdot y}{2}}
x - \frac{1}{\frac{1 + \frac{x \cdot y}{2}}{y}}
double f(double x, double y) {
        double r231888 = x;
        double r231889 = y;
        double r231890 = 1.0;
        double r231891 = r231888 * r231889;
        double r231892 = 2.0;
        double r231893 = r231891 / r231892;
        double r231894 = r231890 + r231893;
        double r231895 = r231889 / r231894;
        double r231896 = r231888 - r231895;
        return r231896;
}

double f(double x, double y) {
        double r231897 = x;
        double r231898 = 1.0;
        double r231899 = 1.0;
        double r231900 = y;
        double r231901 = r231897 * r231900;
        double r231902 = 2.0;
        double r231903 = r231901 / r231902;
        double r231904 = r231899 + r231903;
        double r231905 = r231904 / r231900;
        double r231906 = r231898 / r231905;
        double r231907 = r231897 - r231906;
        return r231907;
}

Error

Bits error versus x

Bits error versus y

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.0

    \[x - \frac{y}{1 + \frac{x \cdot y}{2}}\]
  2. Using strategy rm
  3. Applied clear-num0.1

    \[\leadsto x - \color{blue}{\frac{1}{\frac{1 + \frac{x \cdot y}{2}}{y}}}\]
  4. Final simplification0.1

    \[\leadsto x - \frac{1}{\frac{1 + \frac{x \cdot y}{2}}{y}}\]

Reproduce

herbie shell --seed 2020001 
(FPCore (x y)
  :name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, B"
  :precision binary64
  (- x (/ y (+ 1 (/ (* x y) 2)))))