Average Error: 0.0 → 0.1
Time: 12.7s
Precision: 64
\[x - \frac{y}{1 + \frac{x \cdot y}{2}}\]
\[x - \frac{1}{\frac{1}{y} + 0.5 \cdot x}\]
x - \frac{y}{1 + \frac{x \cdot y}{2}}
x - \frac{1}{\frac{1}{y} + 0.5 \cdot x}
double f(double x, double y) {
        double r240004 = x;
        double r240005 = y;
        double r240006 = 1.0;
        double r240007 = r240004 * r240005;
        double r240008 = 2.0;
        double r240009 = r240007 / r240008;
        double r240010 = r240006 + r240009;
        double r240011 = r240005 / r240010;
        double r240012 = r240004 - r240011;
        return r240012;
}

double f(double x, double y) {
        double r240013 = x;
        double r240014 = 1.0;
        double r240015 = 1.0;
        double r240016 = y;
        double r240017 = r240015 / r240016;
        double r240018 = 0.5;
        double r240019 = r240018 * r240013;
        double r240020 = r240017 + r240019;
        double r240021 = r240014 / r240020;
        double r240022 = r240013 - r240021;
        return r240022;
}

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. Taylor expanded around 0 0.1

    \[\leadsto x - \frac{1}{\color{blue}{0.5 \cdot x + 1 \cdot \frac{1}{y}}}\]
  5. Simplified0.1

    \[\leadsto x - \frac{1}{\color{blue}{\frac{1}{y} + 0.5 \cdot x}}\]
  6. Final simplification0.1

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

Reproduce

herbie shell --seed 2019303 
(FPCore (x y)
  :name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, B"
  :precision binary64
  (- x (/ y (+ 1 (/ (* x y) 2)))))