Average Error: 0.0 → 0.1
Time: 7.5s
Precision: 64
\[x - \frac{y}{1 + \frac{x \cdot y}{2}}\]
\[x - \frac{1}{\frac{\mathsf{fma}\left(\frac{x}{2}, y, 1\right)}{y}}\]
x - \frac{y}{1 + \frac{x \cdot y}{2}}
x - \frac{1}{\frac{\mathsf{fma}\left(\frac{x}{2}, y, 1\right)}{y}}
double f(double x, double y) {
        double r219710 = x;
        double r219711 = y;
        double r219712 = 1.0;
        double r219713 = r219710 * r219711;
        double r219714 = 2.0;
        double r219715 = r219713 / r219714;
        double r219716 = r219712 + r219715;
        double r219717 = r219711 / r219716;
        double r219718 = r219710 - r219717;
        return r219718;
}

double f(double x, double y) {
        double r219719 = x;
        double r219720 = 1.0;
        double r219721 = 2.0;
        double r219722 = r219719 / r219721;
        double r219723 = y;
        double r219724 = 1.0;
        double r219725 = fma(r219722, r219723, r219724);
        double r219726 = r219725 / r219723;
        double r219727 = r219720 / r219726;
        double r219728 = r219719 - r219727;
        return r219728;
}

Error

Bits error versus x

Bits error versus y

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. Simplified0.1

    \[\leadsto x - \frac{1}{\color{blue}{\frac{\mathsf{fma}\left(\frac{x}{2}, y, 1\right)}{y}}}\]
  5. Final simplification0.1

    \[\leadsto x - \frac{1}{\frac{\mathsf{fma}\left(\frac{x}{2}, y, 1\right)}{y}}\]

Reproduce

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