Average Error: 0.0 → 0.1
Time: 19.6s
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)\]
\[x \cdot \left(-0.7071100000000000163069557856942992657423\right) + \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(x, 0.2706100000000000171951342053944244980812, 2.307529999999999859028321225196123123169\right) \cdot 0.7071100000000000163069557856942992657423}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481000000000000260680366181986755691469, 0.992290000000000005364597654988756403327\right), x, 1\right)}}\right)\right)}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481000000000000260680366181986755691469, 0.992290000000000005364597654988756403327\right), x, 1\right)}}\]
0.7071100000000000163069557856942992657423 \cdot \left(\frac{2.307529999999999859028321225196123123169 + x \cdot 0.2706100000000000171951342053944244980812}{1 + x \cdot \left(0.992290000000000005364597654988756403327 + x \cdot 0.04481000000000000260680366181986755691469\right)} - x\right)
x \cdot \left(-0.7071100000000000163069557856942992657423\right) + \frac{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(x, 0.2706100000000000171951342053944244980812, 2.307529999999999859028321225196123123169\right) \cdot 0.7071100000000000163069557856942992657423}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481000000000000260680366181986755691469, 0.992290000000000005364597654988756403327\right), x, 1\right)}}\right)\right)}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481000000000000260680366181986755691469, 0.992290000000000005364597654988756403327\right), x, 1\right)}}
double f(double x) {
        double r4263171 = 0.70711;
        double r4263172 = 2.30753;
        double r4263173 = x;
        double r4263174 = 0.27061;
        double r4263175 = r4263173 * r4263174;
        double r4263176 = r4263172 + r4263175;
        double r4263177 = 1.0;
        double r4263178 = 0.99229;
        double r4263179 = 0.04481;
        double r4263180 = r4263173 * r4263179;
        double r4263181 = r4263178 + r4263180;
        double r4263182 = r4263173 * r4263181;
        double r4263183 = r4263177 + r4263182;
        double r4263184 = r4263176 / r4263183;
        double r4263185 = r4263184 - r4263173;
        double r4263186 = r4263171 * r4263185;
        return r4263186;
}

double f(double x) {
        double r4263187 = x;
        double r4263188 = 0.70711;
        double r4263189 = -r4263188;
        double r4263190 = r4263187 * r4263189;
        double r4263191 = 0.27061;
        double r4263192 = 2.30753;
        double r4263193 = fma(r4263187, r4263191, r4263192);
        double r4263194 = r4263193 * r4263188;
        double r4263195 = 0.04481;
        double r4263196 = 0.99229;
        double r4263197 = fma(r4263187, r4263195, r4263196);
        double r4263198 = 1.0;
        double r4263199 = fma(r4263197, r4263187, r4263198);
        double r4263200 = sqrt(r4263199);
        double r4263201 = r4263194 / r4263200;
        double r4263202 = log1p(r4263201);
        double r4263203 = expm1(r4263202);
        double r4263204 = r4263203 / r4263200;
        double r4263205 = r4263190 + r4263204;
        return r4263205;
}

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. Using strategy rm
  3. Applied sub-neg0.0

    \[\leadsto 0.7071100000000000163069557856942992657423 \cdot \color{blue}{\left(\frac{2.307529999999999859028321225196123123169 + x \cdot 0.2706100000000000171951342053944244980812}{1 + x \cdot \left(0.992290000000000005364597654988756403327 + x \cdot 0.04481000000000000260680366181986755691469\right)} + \left(-x\right)\right)}\]
  4. Applied distribute-lft-in0.0

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

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, 0.2706100000000000171951342053944244980812, 2.307529999999999859028321225196123123169\right) \cdot 0.7071100000000000163069557856942992657423}{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481000000000000260680366181986755691469, 0.992290000000000005364597654988756403327\right), x, 1\right)}} + 0.7071100000000000163069557856942992657423 \cdot \left(-x\right)\]
  6. Using strategy rm
  7. Applied add-sqr-sqrt0.1

    \[\leadsto \frac{\mathsf{fma}\left(x, 0.2706100000000000171951342053944244980812, 2.307529999999999859028321225196123123169\right) \cdot 0.7071100000000000163069557856942992657423}{\color{blue}{\sqrt{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481000000000000260680366181986755691469, 0.992290000000000005364597654988756403327\right), x, 1\right)} \cdot \sqrt{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481000000000000260680366181986755691469, 0.992290000000000005364597654988756403327\right), x, 1\right)}}} + 0.7071100000000000163069557856942992657423 \cdot \left(-x\right)\]
  8. Applied associate-/r*0.1

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

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

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

Reproduce

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