Average Error: 0.0 → 0.0
Time: 4.3s
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)\]
\[\mathsf{fma}\left(-x, 0.707110000000000016, \sqrt{0.707110000000000016} \cdot \left(\sqrt{0.707110000000000016} \cdot \frac{\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\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)
\mathsf{fma}\left(-x, 0.707110000000000016, \sqrt{0.707110000000000016} \cdot \left(\sqrt{0.707110000000000016} \cdot \frac{\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\right)
double f(double x) {
        double r136763 = 0.70711;
        double r136764 = 2.30753;
        double r136765 = x;
        double r136766 = 0.27061;
        double r136767 = r136765 * r136766;
        double r136768 = r136764 + r136767;
        double r136769 = 1.0;
        double r136770 = 0.99229;
        double r136771 = 0.04481;
        double r136772 = r136765 * r136771;
        double r136773 = r136770 + r136772;
        double r136774 = r136765 * r136773;
        double r136775 = r136769 + r136774;
        double r136776 = r136768 / r136775;
        double r136777 = r136776 - r136765;
        double r136778 = r136763 * r136777;
        return r136778;
}

double f(double x) {
        double r136779 = x;
        double r136780 = -r136779;
        double r136781 = 0.70711;
        double r136782 = sqrt(r136781);
        double r136783 = 0.27061;
        double r136784 = 2.30753;
        double r136785 = fma(r136783, r136779, r136784);
        double r136786 = 0.04481;
        double r136787 = 0.99229;
        double r136788 = fma(r136786, r136779, r136787);
        double r136789 = 1.0;
        double r136790 = fma(r136779, r136788, r136789);
        double r136791 = r136785 / r136790;
        double r136792 = r136782 * r136791;
        double r136793 = r136782 * r136792;
        double r136794 = fma(r136780, r136781, r136793);
        return r136794;
}

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

    \[\leadsto \color{blue}{\mathsf{fma}\left(-x, 0.707110000000000016, \frac{0.707110000000000016 \cdot \mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)}\]
  3. Using strategy rm
  4. Applied *-un-lft-identity0.0

    \[\leadsto \mathsf{fma}\left(-x, 0.707110000000000016, \frac{0.707110000000000016 \cdot \mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\color{blue}{1 \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}}\right)\]
  5. Applied times-frac0.0

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

    \[\leadsto \mathsf{fma}\left(-x, 0.707110000000000016, \color{blue}{0.707110000000000016} \cdot \frac{\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\]
  7. Using strategy rm
  8. Applied add-sqr-sqrt0.0

    \[\leadsto \mathsf{fma}\left(-x, 0.707110000000000016, \color{blue}{\left(\sqrt{0.707110000000000016} \cdot \sqrt{0.707110000000000016}\right)} \cdot \frac{\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\]
  9. Applied associate-*l*0.0

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

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

Reproduce

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