Average Error: 0.0 → 0.0
Time: 3.3s
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)\]
\[\mathsf{fma}\left(-x, 0.707110000000000016, \frac{\mathsf{fma}\left(0.19135103710000001, x, 1.6316775383\right)}{x \cdot \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right) + 1}\right)\]
0.707110000000000016 \cdot \left(\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)} - x\right)
\mathsf{fma}\left(-x, 0.707110000000000016, \frac{\mathsf{fma}\left(0.19135103710000001, x, 1.6316775383\right)}{x \cdot \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right) + 1}\right)
double f(double x) {
        double r81090 = 0.70711;
        double r81091 = 2.30753;
        double r81092 = x;
        double r81093 = 0.27061;
        double r81094 = r81092 * r81093;
        double r81095 = r81091 + r81094;
        double r81096 = 1.0;
        double r81097 = 0.99229;
        double r81098 = 0.04481;
        double r81099 = r81092 * r81098;
        double r81100 = r81097 + r81099;
        double r81101 = r81092 * r81100;
        double r81102 = r81096 + r81101;
        double r81103 = r81095 / r81102;
        double r81104 = r81103 - r81092;
        double r81105 = r81090 * r81104;
        return r81105;
}

double f(double x) {
        double r81106 = x;
        double r81107 = -r81106;
        double r81108 = 0.70711;
        double r81109 = 0.1913510371;
        double r81110 = 1.6316775383;
        double r81111 = fma(r81109, r81106, r81110);
        double r81112 = 0.04481;
        double r81113 = 0.99229;
        double r81114 = fma(r81112, r81106, r81113);
        double r81115 = r81106 * r81114;
        double r81116 = 1.0;
        double r81117 = r81115 + r81116;
        double r81118 = r81111 / r81117;
        double r81119 = fma(r81107, r81108, r81118);
        return r81119;
}

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. Simplified0.0

    \[\leadsto \color{blue}{\mathsf{fma}\left(-x, 0.707110000000000016, \frac{0.707110000000000016 \cdot \mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.0

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

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

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

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

Reproduce

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