Average Error: 0.0 → 0.0
Time: 11.8s
Precision: 64
\[x - \frac{y}{1.0 + \frac{x \cdot y}{2.0}}\]
\[x - \frac{y}{\frac{x \cdot y}{2.0} + 1.0}\]
x - \frac{y}{1.0 + \frac{x \cdot y}{2.0}}
x - \frac{y}{\frac{x \cdot y}{2.0} + 1.0}
double f(double x, double y) {
        double r14237339 = x;
        double r14237340 = y;
        double r14237341 = 1.0;
        double r14237342 = r14237339 * r14237340;
        double r14237343 = 2.0;
        double r14237344 = r14237342 / r14237343;
        double r14237345 = r14237341 + r14237344;
        double r14237346 = r14237340 / r14237345;
        double r14237347 = r14237339 - r14237346;
        return r14237347;
}

double f(double x, double y) {
        double r14237348 = x;
        double r14237349 = y;
        double r14237350 = r14237348 * r14237349;
        double r14237351 = 2.0;
        double r14237352 = r14237350 / r14237351;
        double r14237353 = 1.0;
        double r14237354 = r14237352 + r14237353;
        double r14237355 = r14237349 / r14237354;
        double r14237356 = r14237348 - r14237355;
        return r14237356;
}

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.0 + \frac{x \cdot y}{2.0}}\]
  2. Using strategy rm
  3. Applied div-inv0.1

    \[\leadsto x - \color{blue}{y \cdot \frac{1}{1.0 + \frac{x \cdot y}{2.0}}}\]
  4. Using strategy rm
  5. Applied un-div-inv0.0

    \[\leadsto x - \color{blue}{\frac{y}{1.0 + \frac{x \cdot y}{2.0}}}\]
  6. Final simplification0.0

    \[\leadsto x - \frac{y}{\frac{x \cdot y}{2.0} + 1.0}\]

Reproduce

herbie shell --seed 2019164 
(FPCore (x y)
  :name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, B"
  (- x (/ y (+ 1.0 (/ (* x y) 2.0)))))