Average Error: 0.0 → 0.1
Time: 12.9s
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 r243099 = x;
        double r243100 = y;
        double r243101 = 1.0;
        double r243102 = r243099 * r243100;
        double r243103 = 2.0;
        double r243104 = r243102 / r243103;
        double r243105 = r243101 + r243104;
        double r243106 = r243100 / r243105;
        double r243107 = r243099 - r243106;
        return r243107;
}

double f(double x, double y) {
        double r243108 = x;
        double r243109 = 1.0;
        double r243110 = 1.0;
        double r243111 = y;
        double r243112 = r243108 * r243111;
        double r243113 = 2.0;
        double r243114 = r243112 / r243113;
        double r243115 = r243110 + r243114;
        double r243116 = r243115 / r243111;
        double r243117 = r243109 / r243116;
        double r243118 = r243108 - r243117;
        return r243118;
}

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 2019298 
(FPCore (x y)
  :name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, B"
  :precision binary64
  (- x (/ y (+ 1 (/ (* x y) 2)))))