Average Error: 0.0 → 0.0
Time: 3.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)\]
\[\mathsf{fma}\left(-x, 0.707110000000000016, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(0.19135103710000001, x, 1.6316775383\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\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, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(0.19135103710000001, x, 1.6316775383\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\right)\right)
double f(double x) {
        double r116924 = 0.70711;
        double r116925 = 2.30753;
        double r116926 = x;
        double r116927 = 0.27061;
        double r116928 = r116926 * r116927;
        double r116929 = r116925 + r116928;
        double r116930 = 1.0;
        double r116931 = 0.99229;
        double r116932 = 0.04481;
        double r116933 = r116926 * r116932;
        double r116934 = r116931 + r116933;
        double r116935 = r116926 * r116934;
        double r116936 = r116930 + r116935;
        double r116937 = r116929 / r116936;
        double r116938 = r116937 - r116926;
        double r116939 = r116924 * r116938;
        return r116939;
}

double f(double x) {
        double r116940 = x;
        double r116941 = -r116940;
        double r116942 = 0.70711;
        double r116943 = 0.1913510371;
        double r116944 = 1.6316775383;
        double r116945 = fma(r116943, r116940, r116944);
        double r116946 = 0.04481;
        double r116947 = 0.99229;
        double r116948 = fma(r116946, r116940, r116947);
        double r116949 = 1.0;
        double r116950 = fma(r116940, r116948, r116949);
        double r116951 = r116945 / r116950;
        double r116952 = expm1(r116951);
        double r116953 = log1p(r116952);
        double r116954 = fma(r116941, r116942, r116953);
        return r116954;
}

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 log1p-expm1-u0.0

    \[\leadsto \mathsf{fma}\left(-x, 0.707110000000000016, \color{blue}{\mathsf{log1p}\left(\mathsf{expm1}\left(\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)\right)}\right)\]
  5. Taylor expanded around 0 0.0

    \[\leadsto \mathsf{fma}\left(-x, 0.707110000000000016, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\color{blue}{0.19135103710000001 \cdot x + 1.6316775383}}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\right)\right)\]
  6. Simplified0.0

    \[\leadsto \mathsf{fma}\left(-x, 0.707110000000000016, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\color{blue}{\mathsf{fma}\left(0.19135103710000001, x, 1.6316775383\right)}}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\right)\right)\]
  7. Final simplification0.0

    \[\leadsto \mathsf{fma}\left(-x, 0.707110000000000016, \mathsf{log1p}\left(\mathsf{expm1}\left(\frac{\mathsf{fma}\left(0.19135103710000001, x, 1.6316775383\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\right)\right)\]

Reproduce

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