Average Error: 0.0 → 0.1
Time: 3.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 r274814 = x;
        double r274815 = y;
        double r274816 = 1.0;
        double r274817 = r274814 * r274815;
        double r274818 = 2.0;
        double r274819 = r274817 / r274818;
        double r274820 = r274816 + r274819;
        double r274821 = r274815 / r274820;
        double r274822 = r274814 - r274821;
        return r274822;
}

double f(double x, double y) {
        double r274823 = x;
        double r274824 = 1.0;
        double r274825 = 1.0;
        double r274826 = y;
        double r274827 = r274823 * r274826;
        double r274828 = 2.0;
        double r274829 = r274827 / r274828;
        double r274830 = r274825 + r274829;
        double r274831 = r274830 / r274826;
        double r274832 = r274824 / r274831;
        double r274833 = r274823 - r274832;
        return r274833;
}

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