Average Error: 0.0 → 0.0
Time: 15.8s
Precision: 64
\[0.70711 \cdot \left(\frac{2.30753 + x \cdot 0.27061}{1.0 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x\right)\]
\[0.70711 \cdot \left(\frac{1}{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1.0\right)}{\mathsf{fma}\left(0.27061, x, 2.30753\right)}} - x\right)\]
0.70711 \cdot \left(\frac{2.30753 + x \cdot 0.27061}{1.0 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x\right)
0.70711 \cdot \left(\frac{1}{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1.0\right)}{\mathsf{fma}\left(0.27061, x, 2.30753\right)}} - x\right)
double f(double x) {
        double r5004759 = 0.70711;
        double r5004760 = 2.30753;
        double r5004761 = x;
        double r5004762 = 0.27061;
        double r5004763 = r5004761 * r5004762;
        double r5004764 = r5004760 + r5004763;
        double r5004765 = 1.0;
        double r5004766 = 0.99229;
        double r5004767 = 0.04481;
        double r5004768 = r5004761 * r5004767;
        double r5004769 = r5004766 + r5004768;
        double r5004770 = r5004761 * r5004769;
        double r5004771 = r5004765 + r5004770;
        double r5004772 = r5004764 / r5004771;
        double r5004773 = r5004772 - r5004761;
        double r5004774 = r5004759 * r5004773;
        return r5004774;
}

double f(double x) {
        double r5004775 = 0.70711;
        double r5004776 = 1.0;
        double r5004777 = x;
        double r5004778 = 0.04481;
        double r5004779 = 0.99229;
        double r5004780 = fma(r5004777, r5004778, r5004779);
        double r5004781 = 1.0;
        double r5004782 = fma(r5004777, r5004780, r5004781);
        double r5004783 = 0.27061;
        double r5004784 = 2.30753;
        double r5004785 = fma(r5004783, r5004777, r5004784);
        double r5004786 = r5004782 / r5004785;
        double r5004787 = r5004776 / r5004786;
        double r5004788 = r5004787 - r5004777;
        double r5004789 = r5004775 * r5004788;
        return r5004789;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[0.70711 \cdot \left(\frac{2.30753 + x \cdot 0.27061}{1.0 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x\right)\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\left(\frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1.0\right)} - x\right) \cdot 0.70711}\]
  3. Using strategy rm
  4. Applied clear-num0.0

    \[\leadsto \left(\color{blue}{\frac{1}{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1.0\right)}{\mathsf{fma}\left(0.27061, x, 2.30753\right)}}} - x\right) \cdot 0.70711\]
  5. Final simplification0.0

    \[\leadsto 0.70711 \cdot \left(\frac{1}{\frac{\mathsf{fma}\left(x, \mathsf{fma}\left(x, 0.04481, 0.99229\right), 1.0\right)}{\mathsf{fma}\left(0.27061, x, 2.30753\right)}} - x\right)\]

Reproduce

herbie shell --seed 2019162 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, B"
  (* 0.70711 (- (/ (+ 2.30753 (* x 0.27061)) (+ 1.0 (* x (+ 0.99229 (* x 0.04481))))) x)))