Average Error: 0.0 → 0.1
Time: 5.9s
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 r5021615 = x;
        double r5021616 = y;
        double r5021617 = 1.0;
        double r5021618 = r5021615 * r5021616;
        double r5021619 = 2.0;
        double r5021620 = r5021618 / r5021619;
        double r5021621 = r5021617 + r5021620;
        double r5021622 = r5021616 / r5021621;
        double r5021623 = r5021615 - r5021622;
        return r5021623;
}

double f(double x, double y) {
        double r5021624 = x;
        double r5021625 = 1.0;
        double r5021626 = 1.0;
        double r5021627 = y;
        double r5021628 = r5021627 * r5021624;
        double r5021629 = 2.0;
        double r5021630 = r5021628 / r5021629;
        double r5021631 = r5021626 + r5021630;
        double r5021632 = r5021631 / r5021627;
        double r5021633 = r5021625 / r5021632;
        double r5021634 = r5021624 - r5021633;
        return r5021634;
}

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 2019156 
(FPCore (x y)
  :name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, B"
  (- x (/ y (+ 1.0 (/ (* x y) 2.0)))))