Average Error: 0.0 → 0.1
Time: 13.4s
Precision: 64
\[x - \frac{y}{1.0 + \frac{x \cdot y}{2.0}}\]
\[x - \frac{1}{\frac{1.0 + \frac{y \cdot x}{2.0}}{y}}\]
x - \frac{y}{1.0 + \frac{x \cdot y}{2.0}}
x - \frac{1}{\frac{1.0 + \frac{y \cdot x}{2.0}}{y}}
double f(double x, double y) {
        double r12222950 = x;
        double r12222951 = y;
        double r12222952 = 1.0;
        double r12222953 = r12222950 * r12222951;
        double r12222954 = 2.0;
        double r12222955 = r12222953 / r12222954;
        double r12222956 = r12222952 + r12222955;
        double r12222957 = r12222951 / r12222956;
        double r12222958 = r12222950 - r12222957;
        return r12222958;
}

double f(double x, double y) {
        double r12222959 = x;
        double r12222960 = 1.0;
        double r12222961 = 1.0;
        double r12222962 = y;
        double r12222963 = r12222962 * r12222959;
        double r12222964 = 2.0;
        double r12222965 = r12222963 / r12222964;
        double r12222966 = r12222961 + r12222965;
        double r12222967 = r12222966 / r12222962;
        double r12222968 = r12222960 / r12222967;
        double r12222969 = r12222959 - r12222968;
        return r12222969;
}

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.0 + \frac{x \cdot y}{2.0}}\]
  2. Using strategy rm
  3. Applied clear-num0.1

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

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

Reproduce

herbie shell --seed 2019162 
(FPCore (x y)
  :name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, B"
  (- x (/ y (+ 1.0 (/ (* x y) 2.0)))))