Average Error: 0.0 → 0.1
Time: 2.1s
Precision: 64
\[x - \frac{y}{1 + \frac{x \cdot y}{2}}\]
\[x - \frac{1}{0.5 \cdot x + 1 \cdot \frac{1}{y}}\]
x - \frac{y}{1 + \frac{x \cdot y}{2}}
x - \frac{1}{0.5 \cdot x + 1 \cdot \frac{1}{y}}
double f(double x, double y) {
        double r328232 = x;
        double r328233 = y;
        double r328234 = 1.0;
        double r328235 = r328232 * r328233;
        double r328236 = 2.0;
        double r328237 = r328235 / r328236;
        double r328238 = r328234 + r328237;
        double r328239 = r328233 / r328238;
        double r328240 = r328232 - r328239;
        return r328240;
}

double f(double x, double y) {
        double r328241 = x;
        double r328242 = 1.0;
        double r328243 = 0.5;
        double r328244 = r328243 * r328241;
        double r328245 = 1.0;
        double r328246 = y;
        double r328247 = r328242 / r328246;
        double r328248 = r328245 * r328247;
        double r328249 = r328244 + r328248;
        double r328250 = r328242 / r328249;
        double r328251 = r328241 - r328250;
        return r328251;
}

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. Final simplification0.1

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

Reproduce

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