Average Error: 0.0 → 0.1
Time: 24.4s
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(\frac{\mathsf{fma}\left(0.2706100000000000171951342053944244980812, x, 2.307529999999999859028321225196123123169\right)}{\mathsf{expm1}\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.04481000000000000260680366181986755691469, x, 0.992290000000000005364597654988756403327\right), x, 1\right)\right)\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(\frac{\mathsf{fma}\left(0.2706100000000000171951342053944244980812, x, 2.307529999999999859028321225196123123169\right)}{\mathsf{expm1}\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.04481000000000000260680366181986755691469, x, 0.992290000000000005364597654988756403327\right), x, 1\right)\right)\right)\right)\right)} - x\right) \cdot 0.7071100000000000163069557856942992657423
double f(double x) {
        double r93487 = 0.70711;
        double r93488 = 2.30753;
        double r93489 = x;
        double r93490 = 0.27061;
        double r93491 = r93489 * r93490;
        double r93492 = r93488 + r93491;
        double r93493 = 1.0;
        double r93494 = 0.99229;
        double r93495 = 0.04481;
        double r93496 = r93489 * r93495;
        double r93497 = r93494 + r93496;
        double r93498 = r93489 * r93497;
        double r93499 = r93493 + r93498;
        double r93500 = r93492 / r93499;
        double r93501 = r93500 - r93489;
        double r93502 = r93487 * r93501;
        return r93502;
}

double f(double x) {
        double r93503 = 0.27061;
        double r93504 = x;
        double r93505 = 2.30753;
        double r93506 = fma(r93503, r93504, r93505);
        double r93507 = 0.04481;
        double r93508 = 0.99229;
        double r93509 = fma(r93507, r93504, r93508);
        double r93510 = 1.0;
        double r93511 = fma(r93509, r93504, r93510);
        double r93512 = log1p(r93511);
        double r93513 = log1p(r93512);
        double r93514 = expm1(r93513);
        double r93515 = expm1(r93514);
        double r93516 = r93506 / r93515;
        double r93517 = r93516 - r93504;
        double r93518 = 0.70711;
        double r93519 = r93517 * r93518;
        return r93519;
}

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(\frac{\mathsf{fma}\left(0.2706100000000000171951342053944244980812, x, 2.307529999999999859028321225196123123169\right)}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.04481000000000000260680366181986755691469, x, 0.992290000000000005364597654988756403327\right), x, 1\right)\right)\right)}} - x\right) \cdot 0.7071100000000000163069557856942992657423\]
  5. Using strategy rm
  6. Applied expm1-log1p-u0.1

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

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

Reproduce

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