Average Error: 0.0 → 0.1
Time: 16.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)\]
\[0.707110000000000016 \cdot \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\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) - 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(\mathsf{expm1}\left(\mathsf{log1p}\left(\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) - x\right)
double f(double x) {
        double r112937 = 0.70711;
        double r112938 = 2.30753;
        double r112939 = x;
        double r112940 = 0.27061;
        double r112941 = r112939 * r112940;
        double r112942 = r112938 + r112941;
        double r112943 = 1.0;
        double r112944 = 0.99229;
        double r112945 = 0.04481;
        double r112946 = r112939 * r112945;
        double r112947 = r112944 + r112946;
        double r112948 = r112939 * r112947;
        double r112949 = r112943 + r112948;
        double r112950 = r112942 / r112949;
        double r112951 = r112950 - r112939;
        double r112952 = r112937 * r112951;
        return r112952;
}

double f(double x) {
        double r112953 = 0.70711;
        double r112954 = 0.27061;
        double r112955 = x;
        double r112956 = 2.30753;
        double r112957 = fma(r112954, r112955, r112956);
        double r112958 = 0.04481;
        double r112959 = 0.99229;
        double r112960 = fma(r112958, r112955, r112959);
        double r112961 = 1.0;
        double r112962 = fma(r112955, r112960, r112961);
        double r112963 = r112957 / r112962;
        double r112964 = log1p(r112963);
        double r112965 = expm1(r112964);
        double r112966 = r112965 - r112955;
        double r112967 = r112953 * r112966;
        return r112967;
}

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. Using strategy rm
  3. Applied expm1-log1p-u0.1

    \[\leadsto 0.707110000000000016 \cdot \left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)}\right)\right)} - x\right)\]
  4. Simplified0.1

    \[\leadsto 0.707110000000000016 \cdot \left(\mathsf{expm1}\left(\color{blue}{\mathsf{log1p}\left(\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) - x\right)\]
  5. Final simplification0.1

    \[\leadsto 0.707110000000000016 \cdot \left(\mathsf{expm1}\left(\mathsf{log1p}\left(\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) - x\right)\]

Reproduce

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