Average Error: 0.0 → 0.1
Time: 4.1s
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 r190274 = x;
        double r190275 = y;
        double r190276 = 1.0;
        double r190277 = r190274 * r190275;
        double r190278 = 2.0;
        double r190279 = r190277 / r190278;
        double r190280 = r190276 + r190279;
        double r190281 = r190275 / r190280;
        double r190282 = r190274 - r190281;
        return r190282;
}

double f(double x, double y) {
        double r190283 = x;
        double r190284 = 1.0;
        double r190285 = 1.0;
        double r190286 = y;
        double r190287 = r190283 * r190286;
        double r190288 = 2.0;
        double r190289 = r190287 / r190288;
        double r190290 = r190285 + r190289;
        double r190291 = r190290 / r190286;
        double r190292 = r190284 / r190291;
        double r190293 = r190283 - r190292;
        return r190293;
}

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