Average Error: 0.0 → 0.1
Time: 14.3s
Precision: 64
\[x - \frac{y}{1 + \frac{x \cdot y}{2}}\]
\[x - y \cdot \frac{1}{1 + \frac{x}{\frac{2}{y}}}\]
x - \frac{y}{1 + \frac{x \cdot y}{2}}
x - y \cdot \frac{1}{1 + \frac{x}{\frac{2}{y}}}
double f(double x, double y) {
        double r180831 = x;
        double r180832 = y;
        double r180833 = 1.0;
        double r180834 = r180831 * r180832;
        double r180835 = 2.0;
        double r180836 = r180834 / r180835;
        double r180837 = r180833 + r180836;
        double r180838 = r180832 / r180837;
        double r180839 = r180831 - r180838;
        return r180839;
}

double f(double x, double y) {
        double r180840 = x;
        double r180841 = y;
        double r180842 = 1.0;
        double r180843 = 1.0;
        double r180844 = 2.0;
        double r180845 = r180844 / r180841;
        double r180846 = r180840 / r180845;
        double r180847 = r180843 + r180846;
        double r180848 = r180842 / r180847;
        double r180849 = r180841 * r180848;
        double r180850 = r180840 - r180849;
        return r180850;
}

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 associate-/l*0.0

    \[\leadsto x - \frac{y}{1 + \color{blue}{\frac{x}{\frac{2}{y}}}}\]
  4. Using strategy rm
  5. Applied div-inv0.1

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

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

Reproduce

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