Average Error: 0.0 → 0.1
Time: 8.9s
Precision: 64
\[x - \frac{y}{1 + \frac{x \cdot y}{2}}\]
\[x - \frac{1}{\frac{1 + \frac{y \cdot x}{2}}{y}}\]
x - \frac{y}{1 + \frac{x \cdot y}{2}}
x - \frac{1}{\frac{1 + \frac{y \cdot x}{2}}{y}}
double f(double x, double y) {
        double r14603290 = x;
        double r14603291 = y;
        double r14603292 = 1.0;
        double r14603293 = r14603290 * r14603291;
        double r14603294 = 2.0;
        double r14603295 = r14603293 / r14603294;
        double r14603296 = r14603292 + r14603295;
        double r14603297 = r14603291 / r14603296;
        double r14603298 = r14603290 - r14603297;
        return r14603298;
}

double f(double x, double y) {
        double r14603299 = x;
        double r14603300 = 1.0;
        double r14603301 = 1.0;
        double r14603302 = y;
        double r14603303 = r14603302 * r14603299;
        double r14603304 = 2.0;
        double r14603305 = r14603303 / r14603304;
        double r14603306 = r14603301 + r14603305;
        double r14603307 = r14603306 / r14603302;
        double r14603308 = r14603300 / r14603307;
        double r14603309 = r14603299 - r14603308;
        return r14603309;
}

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{y \cdot x}{2}}{y}}\]

Reproduce

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