Average Error: 0.0 → 0.0
Time: 3.5s
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 r270132 = x;
        double r270133 = y;
        double r270134 = 1.0;
        double r270135 = r270132 * r270133;
        double r270136 = 2.0;
        double r270137 = r270135 / r270136;
        double r270138 = r270134 + r270137;
        double r270139 = r270133 / r270138;
        double r270140 = r270132 - r270139;
        return r270140;
}

double f(double x, double y) {
        double r270141 = x;
        double r270142 = 1.0;
        double r270143 = 0.5;
        double r270144 = r270143 * r270141;
        double r270145 = 1.0;
        double r270146 = y;
        double r270147 = r270142 / r270146;
        double r270148 = r270145 * r270147;
        double r270149 = r270144 + r270148;
        double r270150 = r270142 / r270149;
        double r270151 = r270141 - r270150;
        return r270151;
}

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

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

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)))))