Average Error: 0.0 → 0.0
Time: 23.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)\]
\[\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 r4461236 = 0.70711;
        double r4461237 = 2.30753;
        double r4461238 = x;
        double r4461239 = 0.27061;
        double r4461240 = r4461238 * r4461239;
        double r4461241 = r4461237 + r4461240;
        double r4461242 = 1.0;
        double r4461243 = 0.99229;
        double r4461244 = 0.04481;
        double r4461245 = r4461238 * r4461244;
        double r4461246 = r4461243 + r4461245;
        double r4461247 = r4461238 * r4461246;
        double r4461248 = r4461242 + r4461247;
        double r4461249 = r4461241 / r4461248;
        double r4461250 = r4461249 - r4461238;
        double r4461251 = r4461236 * r4461250;
        return r4461251;
}

double f(double x) {
        double r4461252 = 0.27061;
        double r4461253 = x;
        double r4461254 = 2.30753;
        double r4461255 = fma(r4461252, r4461253, r4461254);
        double r4461256 = 0.04481;
        double r4461257 = 0.99229;
        double r4461258 = fma(r4461253, r4461256, r4461257);
        double r4461259 = 1.0;
        double r4461260 = fma(r4461253, r4461258, r4461259);
        double r4461261 = r4461255 / r4461260;
        double r4461262 = r4461261 - r4461253;
        double r4461263 = 0.70711;
        double r4461264 = r4461262 * r4461263;
        return r4461264;
}

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 2019158 +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)))