Average Error: 0.0 → 0.0
Time: 19.7s
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)\]
\[x \cdot \left(-0.70711\right) + \frac{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}{\mathsf{fma}\left(\mathsf{fma}\left(0.04481, x, 0.99229\right), x, 1.0\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)
x \cdot \left(-0.70711\right) + \frac{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}{\mathsf{fma}\left(\mathsf{fma}\left(0.04481, x, 0.99229\right), x, 1.0\right)} \cdot 0.70711
double f(double x) {
        double r3944335 = 0.70711;
        double r3944336 = 2.30753;
        double r3944337 = x;
        double r3944338 = 0.27061;
        double r3944339 = r3944337 * r3944338;
        double r3944340 = r3944336 + r3944339;
        double r3944341 = 1.0;
        double r3944342 = 0.99229;
        double r3944343 = 0.04481;
        double r3944344 = r3944337 * r3944343;
        double r3944345 = r3944342 + r3944344;
        double r3944346 = r3944337 * r3944345;
        double r3944347 = r3944341 + r3944346;
        double r3944348 = r3944340 / r3944347;
        double r3944349 = r3944348 - r3944337;
        double r3944350 = r3944335 * r3944349;
        return r3944350;
}

double f(double x) {
        double r3944351 = x;
        double r3944352 = 0.70711;
        double r3944353 = -r3944352;
        double r3944354 = r3944351 * r3944353;
        double r3944355 = 0.27061;
        double r3944356 = 2.30753;
        double r3944357 = fma(r3944351, r3944355, r3944356);
        double r3944358 = 0.04481;
        double r3944359 = 0.99229;
        double r3944360 = fma(r3944358, r3944351, r3944359);
        double r3944361 = 1.0;
        double r3944362 = fma(r3944360, r3944351, r3944361);
        double r3944363 = r3944357 / r3944362;
        double r3944364 = r3944363 * r3944352;
        double r3944365 = r3944354 + r3944364;
        return r3944365;
}

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}{0.70711 \cdot \left(\frac{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}{\mathsf{fma}\left(\mathsf{fma}\left(0.04481, x, 0.99229\right), x, 1.0\right)} - x\right)}\]
  3. Using strategy rm
  4. Applied sub-neg0.0

    \[\leadsto 0.70711 \cdot \color{blue}{\left(\frac{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}{\mathsf{fma}\left(\mathsf{fma}\left(0.04481, x, 0.99229\right), x, 1.0\right)} + \left(-x\right)\right)}\]
  5. Applied distribute-rgt-in0.0

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

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

Reproduce

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