Average Error: 0.0 → 0.1
Time: 2.5s
Precision: 64
\[x - \frac{y}{1 + \frac{x \cdot y}{2}}\]
\[x - \frac{1}{\frac{1 + \frac{x \cdot y}{2}}{y}}\]
x - \frac{y}{1 + \frac{x \cdot y}{2}}
x - \frac{1}{\frac{1 + \frac{x \cdot y}{2}}{y}}
double f(double x, double y) {
        double r207636 = x;
        double r207637 = y;
        double r207638 = 1.0;
        double r207639 = r207636 * r207637;
        double r207640 = 2.0;
        double r207641 = r207639 / r207640;
        double r207642 = r207638 + r207641;
        double r207643 = r207637 / r207642;
        double r207644 = r207636 - r207643;
        return r207644;
}

double f(double x, double y) {
        double r207645 = x;
        double r207646 = 1.0;
        double r207647 = 1.0;
        double r207648 = y;
        double r207649 = r207645 * r207648;
        double r207650 = 2.0;
        double r207651 = r207649 / r207650;
        double r207652 = r207647 + r207651;
        double r207653 = r207652 / r207648;
        double r207654 = r207646 / r207653;
        double r207655 = r207645 - r207654;
        return r207655;
}

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

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

Reproduce

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