Average Error: 0.0 → 0.0
Time: 18.7s
Precision: 64
\[0.707110000000000016 \cdot \left(\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)} - x\right)\]
\[\frac{\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)} \cdot 0.707110000000000016 + \left(-x\right) \cdot 0.707110000000000016\]
0.707110000000000016 \cdot \left(\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)} - x\right)
\frac{\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)} \cdot 0.707110000000000016 + \left(-x\right) \cdot 0.707110000000000016
double f(double x) {
        double r111286 = 0.70711;
        double r111287 = 2.30753;
        double r111288 = x;
        double r111289 = 0.27061;
        double r111290 = r111288 * r111289;
        double r111291 = r111287 + r111290;
        double r111292 = 1.0;
        double r111293 = 0.99229;
        double r111294 = 0.04481;
        double r111295 = r111288 * r111294;
        double r111296 = r111293 + r111295;
        double r111297 = r111288 * r111296;
        double r111298 = r111292 + r111297;
        double r111299 = r111291 / r111298;
        double r111300 = r111299 - r111288;
        double r111301 = r111286 * r111300;
        return r111301;
}

double f(double x) {
        double r111302 = 0.27061;
        double r111303 = x;
        double r111304 = 2.30753;
        double r111305 = fma(r111302, r111303, r111304);
        double r111306 = 0.04481;
        double r111307 = 0.99229;
        double r111308 = fma(r111306, r111303, r111307);
        double r111309 = 1.0;
        double r111310 = fma(r111303, r111308, r111309);
        double r111311 = r111305 / r111310;
        double r111312 = 0.70711;
        double r111313 = r111311 * r111312;
        double r111314 = -r111303;
        double r111315 = r111314 * r111312;
        double r111316 = r111313 + r111315;
        return r111316;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[0.707110000000000016 \cdot \left(\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)} - x\right)\]
  2. Using strategy rm
  3. Applied sub-neg0.0

    \[\leadsto 0.707110000000000016 \cdot \color{blue}{\left(\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)} + \left(-x\right)\right)}\]
  4. Applied distribute-lft-in0.0

    \[\leadsto \color{blue}{0.707110000000000016 \cdot \frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)} + 0.707110000000000016 \cdot \left(-x\right)}\]
  5. Simplified0.0

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)} \cdot 0.707110000000000016} + 0.707110000000000016 \cdot \left(-x\right)\]
  6. Simplified0.0

    \[\leadsto \frac{\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)} \cdot 0.707110000000000016 + \color{blue}{\left(-x\right) \cdot 0.707110000000000016}\]
  7. Final simplification0.0

    \[\leadsto \frac{\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)} \cdot 0.707110000000000016 + \left(-x\right) \cdot 0.707110000000000016\]

Reproduce

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