Average Error: 0.0 → 0.0
Time: 8.8s
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 r166164 = x;
        double r166165 = y;
        double r166166 = 1.0;
        double r166167 = r166164 * r166165;
        double r166168 = 2.0;
        double r166169 = r166167 / r166168;
        double r166170 = r166166 + r166169;
        double r166171 = r166165 / r166170;
        double r166172 = r166164 - r166171;
        return r166172;
}

double f(double x, double y) {
        double r166173 = x;
        double r166174 = 1.0;
        double r166175 = 1.0;
        double r166176 = y;
        double r166177 = r166175 / r166176;
        double r166178 = 0.5;
        double r166179 = r166178 * r166173;
        double r166180 = r166177 + r166179;
        double r166181 = r166174 / r166180;
        double r166182 = r166173 - r166181;
        return r166182;
}

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