Average Error: 0.0 → 0.0
Time: 11.6s
Precision: 64
\[x - \frac{y}{1 + \frac{x \cdot y}{2}}\]
\[x - \frac{1}{\frac{1}{y} + 0.5 \cdot x}\]
x - \frac{y}{1 + \frac{x \cdot y}{2}}
x - \frac{1}{\frac{1}{y} + 0.5 \cdot x}
double f(double x, double y) {
        double r174008 = x;
        double r174009 = y;
        double r174010 = 1.0;
        double r174011 = r174008 * r174009;
        double r174012 = 2.0;
        double r174013 = r174011 / r174012;
        double r174014 = r174010 + r174013;
        double r174015 = r174009 / r174014;
        double r174016 = r174008 - r174015;
        return r174016;
}

double f(double x, double y) {
        double r174017 = x;
        double r174018 = 1.0;
        double r174019 = 1.0;
        double r174020 = y;
        double r174021 = r174019 / r174020;
        double r174022 = 0.5;
        double r174023 = r174022 * r174017;
        double r174024 = r174021 + r174023;
        double r174025 = r174018 / r174024;
        double r174026 = r174017 - r174025;
        return r174026;
}

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.0

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

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

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

Reproduce

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