Average Error: 0.0 → 0.0
Time: 3.5s
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)\]
\[0.707110000000000016 \cdot \left(\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right)} - x\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)
0.707110000000000016 \cdot \left(\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right)} - x\right)
double f(double x) {
        double r85707 = 0.70711;
        double r85708 = 2.30753;
        double r85709 = x;
        double r85710 = 0.27061;
        double r85711 = r85709 * r85710;
        double r85712 = r85708 + r85711;
        double r85713 = 1.0;
        double r85714 = 0.99229;
        double r85715 = 0.04481;
        double r85716 = r85709 * r85715;
        double r85717 = r85714 + r85716;
        double r85718 = r85709 * r85717;
        double r85719 = r85713 + r85718;
        double r85720 = r85712 / r85719;
        double r85721 = r85720 - r85709;
        double r85722 = r85707 * r85721;
        return r85722;
}

double f(double x) {
        double r85723 = 0.70711;
        double r85724 = 2.30753;
        double r85725 = x;
        double r85726 = 0.27061;
        double r85727 = r85725 * r85726;
        double r85728 = r85724 + r85727;
        double r85729 = 1.0;
        double r85730 = 0.04481;
        double r85731 = 0.99229;
        double r85732 = fma(r85730, r85725, r85731);
        double r85733 = r85725 * r85732;
        double r85734 = r85729 + r85733;
        double r85735 = r85728 / r85734;
        double r85736 = r85735 - r85725;
        double r85737 = r85723 * r85736;
        return r85737;
}

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. Taylor expanded around 0 0.0

    \[\leadsto 0.707110000000000016 \cdot \left(\frac{2.30753 + x \cdot 0.27061000000000002}{1 + \color{blue}{\left(0.044810000000000003 \cdot {x}^{2} + 0.992290000000000005 \cdot x\right)}} - x\right)\]
  3. Simplified0.0

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

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

Reproduce

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