Average Error: 0.0 → 0.0
Time: 2.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, \frac{0.707110000000000016 \cdot \left(0.27061000000000002 \cdot x\right) + 0.707110000000000016 \cdot 2.30753}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\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, \frac{0.707110000000000016 \cdot \left(0.27061000000000002 \cdot x\right) + 0.707110000000000016 \cdot 2.30753}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)
double f(double x) {
        double r122912 = 0.70711;
        double r122913 = 2.30753;
        double r122914 = x;
        double r122915 = 0.27061;
        double r122916 = r122914 * r122915;
        double r122917 = r122913 + r122916;
        double r122918 = 1.0;
        double r122919 = 0.99229;
        double r122920 = 0.04481;
        double r122921 = r122914 * r122920;
        double r122922 = r122919 + r122921;
        double r122923 = r122914 * r122922;
        double r122924 = r122918 + r122923;
        double r122925 = r122917 / r122924;
        double r122926 = r122925 - r122914;
        double r122927 = r122912 * r122926;
        return r122927;
}

double f(double x) {
        double r122928 = x;
        double r122929 = -r122928;
        double r122930 = 0.70711;
        double r122931 = 0.27061;
        double r122932 = r122931 * r122928;
        double r122933 = r122930 * r122932;
        double r122934 = 2.30753;
        double r122935 = r122930 * r122934;
        double r122936 = r122933 + r122935;
        double r122937 = 0.04481;
        double r122938 = 0.99229;
        double r122939 = fma(r122937, r122928, r122938);
        double r122940 = 1.0;
        double r122941 = fma(r122928, r122939, r122940);
        double r122942 = r122936 / r122941;
        double r122943 = fma(r122929, r122930, r122942);
        return r122943;
}

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 fma-udef0.0

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

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

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

Reproduce

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