Average Error: 0.0 → 0.1
Time: 8.8s
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 r168637 = x;
        double r168638 = y;
        double r168639 = 1.0;
        double r168640 = r168637 * r168638;
        double r168641 = 2.0;
        double r168642 = r168640 / r168641;
        double r168643 = r168639 + r168642;
        double r168644 = r168638 / r168643;
        double r168645 = r168637 - r168644;
        return r168645;
}

double f(double x, double y) {
        double r168646 = x;
        double r168647 = 1.0;
        double r168648 = 1.0;
        double r168649 = y;
        double r168650 = r168646 * r168649;
        double r168651 = 2.0;
        double r168652 = r168650 / r168651;
        double r168653 = r168648 + r168652;
        double r168654 = r168653 / r168649;
        double r168655 = r168647 / r168654;
        double r168656 = r168646 - r168655;
        return r168656;
}

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