Average Error: 0.0 → 0.1
Time: 12.9s
Precision: 64
\[x - \frac{y}{1 + \frac{x \cdot y}{2}}\]
\[x - \frac{\frac{1}{1 + \frac{y \cdot x}{2}}}{\frac{1}{y}}\]
x - \frac{y}{1 + \frac{x \cdot y}{2}}
x - \frac{\frac{1}{1 + \frac{y \cdot x}{2}}}{\frac{1}{y}}
double f(double x, double y) {
        double r9689852 = x;
        double r9689853 = y;
        double r9689854 = 1.0;
        double r9689855 = r9689852 * r9689853;
        double r9689856 = 2.0;
        double r9689857 = r9689855 / r9689856;
        double r9689858 = r9689854 + r9689857;
        double r9689859 = r9689853 / r9689858;
        double r9689860 = r9689852 - r9689859;
        return r9689860;
}

double f(double x, double y) {
        double r9689861 = x;
        double r9689862 = 1.0;
        double r9689863 = 1.0;
        double r9689864 = y;
        double r9689865 = r9689864 * r9689861;
        double r9689866 = 2.0;
        double r9689867 = r9689865 / r9689866;
        double r9689868 = r9689863 + r9689867;
        double r9689869 = r9689862 / r9689868;
        double r9689870 = r9689862 / r9689864;
        double r9689871 = r9689869 / r9689870;
        double r9689872 = r9689861 - r9689871;
        return r9689872;
}

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. Using strategy rm
  5. Applied div-inv0.1

    \[\leadsto x - \frac{1}{\color{blue}{\left(1 + \frac{x \cdot y}{2}\right) \cdot \frac{1}{y}}}\]
  6. Applied associate-/r*0.1

    \[\leadsto x - \color{blue}{\frac{\frac{1}{1 + \frac{x \cdot y}{2}}}{\frac{1}{y}}}\]
  7. Final simplification0.1

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

Reproduce

herbie shell --seed 2019179 
(FPCore (x y)
  :name "Data.Number.Erf:$cinvnormcdf from erf-2.0.0.0, B"
  (- x (/ y (+ 1.0 (/ (* x y) 2.0)))))