Average Error: 0.0 → 0.1
Time: 16.9s
Precision: 64
\[0.7071100000000000163069557856942992657423 \cdot \left(\frac{2.307529999999999859028321225196123123169 + x \cdot 0.2706100000000000171951342053944244980812}{1 + x \cdot \left(0.992290000000000005364597654988756403327 + x \cdot 0.04481000000000000260680366181986755691469\right)} - x\right)\]
\[\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(0.2706100000000000171951342053944244980812, x, 2.307529999999999859028321225196123123169\right)}{\mathsf{fma}\left(\mathsf{fma}\left(0.04481000000000000260680366181986755691469, x, 0.992290000000000005364597654988756403327\right), x, 1\right)}\right)\right) - x\right) \cdot 0.7071100000000000163069557856942992657423\]
0.7071100000000000163069557856942992657423 \cdot \left(\frac{2.307529999999999859028321225196123123169 + x \cdot 0.2706100000000000171951342053944244980812}{1 + x \cdot \left(0.992290000000000005364597654988756403327 + x \cdot 0.04481000000000000260680366181986755691469\right)} - x\right)
\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(0.2706100000000000171951342053944244980812, x, 2.307529999999999859028321225196123123169\right)}{\mathsf{fma}\left(\mathsf{fma}\left(0.04481000000000000260680366181986755691469, x, 0.992290000000000005364597654988756403327\right), x, 1\right)}\right)\right) - x\right) \cdot 0.7071100000000000163069557856942992657423
double f(double x) {
        double r98203 = 0.70711;
        double r98204 = 2.30753;
        double r98205 = x;
        double r98206 = 0.27061;
        double r98207 = r98205 * r98206;
        double r98208 = r98204 + r98207;
        double r98209 = 1.0;
        double r98210 = 0.99229;
        double r98211 = 0.04481;
        double r98212 = r98205 * r98211;
        double r98213 = r98210 + r98212;
        double r98214 = r98205 * r98213;
        double r98215 = r98209 + r98214;
        double r98216 = r98208 / r98215;
        double r98217 = r98216 - r98205;
        double r98218 = r98203 * r98217;
        return r98218;
}

double f(double x) {
        double r98219 = 0.27061;
        double r98220 = x;
        double r98221 = 2.30753;
        double r98222 = fma(r98219, r98220, r98221);
        double r98223 = 0.04481;
        double r98224 = 0.99229;
        double r98225 = fma(r98223, r98220, r98224);
        double r98226 = 1.0;
        double r98227 = fma(r98225, r98220, r98226);
        double r98228 = r98222 / r98227;
        double r98229 = log1p(r98228);
        double r98230 = expm1(r98229);
        double r98231 = r98230 - r98220;
        double r98232 = 0.70711;
        double r98233 = r98231 * r98232;
        return r98233;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[0.7071100000000000163069557856942992657423 \cdot \left(\frac{2.307529999999999859028321225196123123169 + x \cdot 0.2706100000000000171951342053944244980812}{1 + x \cdot \left(0.992290000000000005364597654988756403327 + x \cdot 0.04481000000000000260680366181986755691469\right)} - x\right)\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\left(\frac{\mathsf{fma}\left(0.2706100000000000171951342053944244980812, x, 2.307529999999999859028321225196123123169\right)}{\mathsf{fma}\left(\mathsf{fma}\left(0.04481000000000000260680366181986755691469, x, 0.992290000000000005364597654988756403327\right), x, 1\right)} - x\right) \cdot 0.7071100000000000163069557856942992657423}\]
  3. Using strategy rm
  4. Applied expm1-log1p-u0.1

    \[\leadsto \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(0.2706100000000000171951342053944244980812, x, 2.307529999999999859028321225196123123169\right)}{\mathsf{fma}\left(\mathsf{fma}\left(0.04481000000000000260680366181986755691469, x, 0.992290000000000005364597654988756403327\right), x, 1\right)}\right)\right)} - x\right) \cdot 0.7071100000000000163069557856942992657423\]
  5. Final simplification0.1

    \[\leadsto \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(0.2706100000000000171951342053944244980812, x, 2.307529999999999859028321225196123123169\right)}{\mathsf{fma}\left(\mathsf{fma}\left(0.04481000000000000260680366181986755691469, x, 0.992290000000000005364597654988756403327\right), x, 1\right)}\right)\right) - x\right) \cdot 0.7071100000000000163069557856942992657423\]

Reproduce

herbie shell --seed 2019208 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:invErfc from math-functions-0.1.5.2, B"
  :precision binary64
  (* 0.707110000000000016 (- (/ (+ 2.30753 (* x 0.27061000000000002)) (+ 1 (* x (+ 0.992290000000000005 (* x 0.044810000000000003))))) x)))