Average Error: 0.0 → 0.0
Time: 1.8s
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 r259049 = x;
        double r259050 = y;
        double r259051 = 1.0;
        double r259052 = r259049 * r259050;
        double r259053 = 2.0;
        double r259054 = r259052 / r259053;
        double r259055 = r259051 + r259054;
        double r259056 = r259050 / r259055;
        double r259057 = r259049 - r259056;
        return r259057;
}

double f(double x, double y) {
        double r259058 = x;
        double r259059 = 1.0;
        double r259060 = 0.5;
        double r259061 = r259060 * r259058;
        double r259062 = 1.0;
        double r259063 = y;
        double r259064 = r259059 / r259063;
        double r259065 = r259062 * r259064;
        double r259066 = r259061 + r259065;
        double r259067 = r259059 / r259066;
        double r259068 = r259058 - r259067;
        return r259068;
}

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