Average Error: 0.0 → 0.0
Time: 17.8s
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{\sqrt{0.7071100000000000163069557856942992657423} \cdot \left(\mathsf{fma}\left(x, 0.2706100000000000171951342053944244980812, 2.307529999999999859028321225196123123169\right) \cdot \sqrt{0.7071100000000000163069557856942992657423}\right)}{\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{\sqrt{0.7071100000000000163069557856942992657423} \cdot \left(\mathsf{fma}\left(x, 0.2706100000000000171951342053944244980812, 2.307529999999999859028321225196123123169\right) \cdot \sqrt{0.7071100000000000163069557856942992657423}\right)}{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481000000000000260680366181986755691469, 0.992290000000000005364597654988756403327\right), x, 1\right)}
double f(double x) {
        double r87359 = 0.70711;
        double r87360 = 2.30753;
        double r87361 = x;
        double r87362 = 0.27061;
        double r87363 = r87361 * r87362;
        double r87364 = r87360 + r87363;
        double r87365 = 1.0;
        double r87366 = 0.99229;
        double r87367 = 0.04481;
        double r87368 = r87361 * r87367;
        double r87369 = r87366 + r87368;
        double r87370 = r87361 * r87369;
        double r87371 = r87365 + r87370;
        double r87372 = r87364 / r87371;
        double r87373 = r87372 - r87361;
        double r87374 = r87359 * r87373;
        return r87374;
}

double f(double x) {
        double r87375 = x;
        double r87376 = 0.70711;
        double r87377 = -r87376;
        double r87378 = r87375 * r87377;
        double r87379 = sqrt(r87376);
        double r87380 = 0.27061;
        double r87381 = 2.30753;
        double r87382 = fma(r87375, r87380, r87381);
        double r87383 = r87382 * r87379;
        double r87384 = r87379 * r87383;
        double r87385 = 0.04481;
        double r87386 = 0.99229;
        double r87387 = fma(r87375, r87385, r87386);
        double r87388 = 1.0;
        double r87389 = fma(r87387, r87375, r87388);
        double r87390 = r87384 / r87389;
        double r87391 = r87378 + r87390;
        return r87391;
}

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

    \[\leadsto \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)} + \color{blue}{\left(-0.7071100000000000163069557856942992657423 \cdot x\right)}\]
  7. Using strategy rm
  8. Applied add-sqr-sqrt0.0

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

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

    \[\leadsto x \cdot \left(-0.7071100000000000163069557856942992657423\right) + \frac{\sqrt{0.7071100000000000163069557856942992657423} \cdot \left(\mathsf{fma}\left(x, 0.2706100000000000171951342053944244980812, 2.307529999999999859028321225196123123169\right) \cdot \sqrt{0.7071100000000000163069557856942992657423}\right)}{\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)))