Average Error: 0.0 → 0.1
Time: 1.4s
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 r253471 = x;
        double r253472 = y;
        double r253473 = 1.0;
        double r253474 = r253471 * r253472;
        double r253475 = 2.0;
        double r253476 = r253474 / r253475;
        double r253477 = r253473 + r253476;
        double r253478 = r253472 / r253477;
        double r253479 = r253471 - r253478;
        return r253479;
}

double f(double x, double y) {
        double r253480 = x;
        double r253481 = 1.0;
        double r253482 = 0.5;
        double r253483 = r253482 * r253480;
        double r253484 = 1.0;
        double r253485 = y;
        double r253486 = r253481 / r253485;
        double r253487 = r253484 * r253486;
        double r253488 = r253483 + r253487;
        double r253489 = r253481 / r253488;
        double r253490 = r253480 - r253489;
        return r253490;
}

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