Average Error: 0.0 → 0.1
Time: 13.0s
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 r12224752 = x;
        double r12224753 = y;
        double r12224754 = 1.0;
        double r12224755 = r12224752 * r12224753;
        double r12224756 = 2.0;
        double r12224757 = r12224755 / r12224756;
        double r12224758 = r12224754 + r12224757;
        double r12224759 = r12224753 / r12224758;
        double r12224760 = r12224752 - r12224759;
        return r12224760;
}

double f(double x, double y) {
        double r12224761 = x;
        double r12224762 = 1.0;
        double r12224763 = 1.0;
        double r12224764 = y;
        double r12224765 = r12224764 * r12224761;
        double r12224766 = 2.0;
        double r12224767 = r12224765 / r12224766;
        double r12224768 = r12224763 + r12224767;
        double r12224769 = r12224768 / r12224764;
        double r12224770 = r12224762 / r12224769;
        double r12224771 = r12224761 - r12224770;
        return r12224771;
}

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)))))