Average Error: 0.0 → 0.1
Time: 3.6s
Precision: 64
\[x - \frac{y}{1 + \frac{x \cdot y}{2}}\]
\[x - \frac{1}{\frac{1}{2} \cdot x + 1 \cdot \frac{1}{y}}\]
x - \frac{y}{1 + \frac{x \cdot y}{2}}
x - \frac{1}{\frac{1}{2} \cdot x + 1 \cdot \frac{1}{y}}
double f(double x, double y) {
        double r207602 = x;
        double r207603 = y;
        double r207604 = 1.0;
        double r207605 = r207602 * r207603;
        double r207606 = 2.0;
        double r207607 = r207605 / r207606;
        double r207608 = r207604 + r207607;
        double r207609 = r207603 / r207608;
        double r207610 = r207602 - r207609;
        return r207610;
}

double f(double x, double y) {
        double r207611 = x;
        double r207612 = 1.0;
        double r207613 = 1.0;
        double r207614 = 2.0;
        double r207615 = r207613 / r207614;
        double r207616 = r207615 * r207611;
        double r207617 = y;
        double r207618 = r207612 / r207617;
        double r207619 = r207613 * r207618;
        double r207620 = r207616 + r207619;
        double r207621 = r207612 / r207620;
        double r207622 = r207611 - r207621;
        return r207622;
}

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. Simplified0.1

    \[\leadsto x - \frac{1}{\color{blue}{\frac{1}{2} \cdot x + 1 \cdot \frac{1}{y}}}\]
  6. Final simplification0.1

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

Reproduce

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