Average Error: 0.0 → 0.1
Time: 2.5s
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 r284932 = x;
        double r284933 = y;
        double r284934 = 1.0;
        double r284935 = r284932 * r284933;
        double r284936 = 2.0;
        double r284937 = r284935 / r284936;
        double r284938 = r284934 + r284937;
        double r284939 = r284933 / r284938;
        double r284940 = r284932 - r284939;
        return r284940;
}

double f(double x, double y) {
        double r284941 = x;
        double r284942 = 1.0;
        double r284943 = 1.0;
        double r284944 = y;
        double r284945 = r284941 * r284944;
        double r284946 = 2.0;
        double r284947 = r284945 / r284946;
        double r284948 = r284943 + r284947;
        double r284949 = r284948 / r284944;
        double r284950 = r284942 / r284949;
        double r284951 = r284941 - r284950;
        return r284951;
}

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