Average Error: 0.0 → 0.0
Time: 10.6s
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)\]
\[\left(\frac{\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(\mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), x, 1\right)} - x\right) \cdot 0.707110000000000016\]
0.707110000000000016 \cdot \left(\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)} - x\right)
\left(\frac{\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(\mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), x, 1\right)} - x\right) \cdot 0.707110000000000016
double f(double x) {
        double r58815 = 0.70711;
        double r58816 = 2.30753;
        double r58817 = x;
        double r58818 = 0.27061;
        double r58819 = r58817 * r58818;
        double r58820 = r58816 + r58819;
        double r58821 = 1.0;
        double r58822 = 0.99229;
        double r58823 = 0.04481;
        double r58824 = r58817 * r58823;
        double r58825 = r58822 + r58824;
        double r58826 = r58817 * r58825;
        double r58827 = r58821 + r58826;
        double r58828 = r58820 / r58827;
        double r58829 = r58828 - r58817;
        double r58830 = r58815 * r58829;
        return r58830;
}

double f(double x) {
        double r58831 = 0.27061;
        double r58832 = x;
        double r58833 = 2.30753;
        double r58834 = fma(r58831, r58832, r58833);
        double r58835 = 0.04481;
        double r58836 = 0.99229;
        double r58837 = fma(r58835, r58832, r58836);
        double r58838 = 1.0;
        double r58839 = fma(r58837, r58832, r58838);
        double r58840 = r58834 / r58839;
        double r58841 = r58840 - r58832;
        double r58842 = 0.70711;
        double r58843 = r58841 * r58842;
        return r58843;
}

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}{\left(\frac{\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(\mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), x, 1\right)} - x\right) \cdot 0.707110000000000016}\]
  3. Final simplification0.0

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

Reproduce

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