Average Error: 0.0 → 0.1
Time: 10.4s
Precision: 64
\[x - \frac{y}{1.0 + \frac{x \cdot y}{2.0}}\]
\[x - \frac{1}{0.5 \cdot x + \frac{1.0}{y}}\]
x - \frac{y}{1.0 + \frac{x \cdot y}{2.0}}
x - \frac{1}{0.5 \cdot x + \frac{1.0}{y}}
double f(double x, double y) {
        double r13603820 = x;
        double r13603821 = y;
        double r13603822 = 1.0;
        double r13603823 = r13603820 * r13603821;
        double r13603824 = 2.0;
        double r13603825 = r13603823 / r13603824;
        double r13603826 = r13603822 + r13603825;
        double r13603827 = r13603821 / r13603826;
        double r13603828 = r13603820 - r13603827;
        return r13603828;
}

double f(double x, double y) {
        double r13603829 = x;
        double r13603830 = 1.0;
        double r13603831 = 0.5;
        double r13603832 = r13603831 * r13603829;
        double r13603833 = 1.0;
        double r13603834 = y;
        double r13603835 = r13603833 / r13603834;
        double r13603836 = r13603832 + r13603835;
        double r13603837 = r13603830 / r13603836;
        double r13603838 = r13603829 - r13603837;
        return r13603838;
}

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 clear-num0.1

    \[\leadsto x - \color{blue}{\frac{1}{\frac{1.0 + \frac{x \cdot y}{2.0}}{y}}}\]
  4. Taylor expanded around 0 0.1

    \[\leadsto x - \frac{1}{\color{blue}{0.5 \cdot x + 1.0 \cdot \frac{1}{y}}}\]
  5. Simplified0.1

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

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

Reproduce

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