Average Error: 0.0 → 0.1
Time: 12.2s
Precision: 64
\[x - \frac{y}{1 + \frac{x \cdot y}{2}}\]
\[x - \frac{1}{\frac{1}{y} + 0.5 \cdot x}\]
x - \frac{y}{1 + \frac{x \cdot y}{2}}
x - \frac{1}{\frac{1}{y} + 0.5 \cdot x}
double f(double x, double y) {
        double r220774 = x;
        double r220775 = y;
        double r220776 = 1.0;
        double r220777 = r220774 * r220775;
        double r220778 = 2.0;
        double r220779 = r220777 / r220778;
        double r220780 = r220776 + r220779;
        double r220781 = r220775 / r220780;
        double r220782 = r220774 - r220781;
        return r220782;
}

double f(double x, double y) {
        double r220783 = x;
        double r220784 = 1.0;
        double r220785 = 1.0;
        double r220786 = y;
        double r220787 = r220785 / r220786;
        double r220788 = 0.5;
        double r220789 = r220788 * r220783;
        double r220790 = r220787 + r220789;
        double r220791 = r220784 / r220790;
        double r220792 = r220783 - r220791;
        return r220792;
}

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. Taylor expanded around 0 0.1

    \[\leadsto x - \frac{1}{\color{blue}{0.5 \cdot x + 1 \cdot \frac{1}{y}}}\]
  5. Simplified0.1

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

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

Reproduce

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