Average Error: 0.0 → 0.0
Time: 7.6s
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)\]
\[\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\]
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)
\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
double f(double x) {
        double r1080819 = 0.70711;
        double r1080820 = 2.30753;
        double r1080821 = x;
        double r1080822 = 0.27061;
        double r1080823 = r1080821 * r1080822;
        double r1080824 = r1080820 + r1080823;
        double r1080825 = 1.0;
        double r1080826 = 0.99229;
        double r1080827 = 0.04481;
        double r1080828 = r1080821 * r1080827;
        double r1080829 = r1080826 + r1080828;
        double r1080830 = r1080821 * r1080829;
        double r1080831 = r1080825 + r1080830;
        double r1080832 = r1080824 / r1080831;
        double r1080833 = r1080832 - r1080821;
        double r1080834 = r1080819 * r1080833;
        return r1080834;
}

double f(double x) {
        double r1080835 = 0.27061;
        double r1080836 = x;
        double r1080837 = 2.30753;
        double r1080838 = fma(r1080835, r1080836, r1080837);
        double r1080839 = 0.04481;
        double r1080840 = 0.99229;
        double r1080841 = fma(r1080836, r1080839, r1080840);
        double r1080842 = 1.0;
        double r1080843 = fma(r1080836, r1080841, r1080842);
        double r1080844 = r1080838 / r1080843;
        double r1080845 = r1080844 - r1080836;
        double r1080846 = 0.70711;
        double r1080847 = r1080845 * r1080846;
        return r1080847;
}

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. Final simplification0.0

    \[\leadsto \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\]

Reproduce

herbie shell --seed 2019156 +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)))