Average Error: 0.0 → 0.1
Time: 10.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 r189823 = x;
        double r189824 = y;
        double r189825 = 1.0;
        double r189826 = r189823 * r189824;
        double r189827 = 2.0;
        double r189828 = r189826 / r189827;
        double r189829 = r189825 + r189828;
        double r189830 = r189824 / r189829;
        double r189831 = r189823 - r189830;
        return r189831;
}

double f(double x, double y) {
        double r189832 = x;
        double r189833 = 1.0;
        double r189834 = 1.0;
        double r189835 = y;
        double r189836 = r189832 * r189835;
        double r189837 = 2.0;
        double r189838 = r189836 / r189837;
        double r189839 = r189834 + r189838;
        double r189840 = r189839 / r189835;
        double r189841 = r189833 / r189840;
        double r189842 = r189832 - r189841;
        return r189842;
}

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