Average Error: 0.0 → 0.1
Time: 3.8s
Precision: 64
\[x - \frac{2.30753 + x \cdot 0.27061000000000002}{1 + \left(0.992290000000000005 + x \cdot 0.044810000000000003\right) \cdot x}\]
\[\frac{-\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)\right)\right)} + x\]
x - \frac{2.30753 + x \cdot 0.27061000000000002}{1 + \left(0.992290000000000005 + x \cdot 0.044810000000000003\right) \cdot x}
\frac{-\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)\right)\right)} + x
double f(double x) {
        double r117928 = x;
        double r117929 = 2.30753;
        double r117930 = 0.27061;
        double r117931 = r117928 * r117930;
        double r117932 = r117929 + r117931;
        double r117933 = 1.0;
        double r117934 = 0.99229;
        double r117935 = 0.04481;
        double r117936 = r117928 * r117935;
        double r117937 = r117934 + r117936;
        double r117938 = r117937 * r117928;
        double r117939 = r117933 + r117938;
        double r117940 = r117932 / r117939;
        double r117941 = r117928 - r117940;
        return r117941;
}

double f(double x) {
        double r117942 = 0.27061;
        double r117943 = x;
        double r117944 = 2.30753;
        double r117945 = fma(r117942, r117943, r117944);
        double r117946 = -r117945;
        double r117947 = 0.04481;
        double r117948 = 0.99229;
        double r117949 = fma(r117947, r117943, r117948);
        double r117950 = 1.0;
        double r117951 = fma(r117943, r117949, r117950);
        double r117952 = log1p(r117951);
        double r117953 = expm1(r117952);
        double r117954 = r117946 / r117953;
        double r117955 = r117954 + r117943;
        return r117955;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[x - \frac{2.30753 + x \cdot 0.27061000000000002}{1 + \left(0.992290000000000005 + x \cdot 0.044810000000000003\right) \cdot x}\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\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)} + x}\]
  3. Using strategy rm
  4. Applied expm1-log1p-u0.1

    \[\leadsto \frac{-\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)\right)\right)}} + x\]
  5. Final simplification0.1

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

Reproduce

herbie shell --seed 2020035 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:invIncompleteBetaWorker from math-functions-0.1.5.2, D"
  :precision binary64
  (- x (/ (+ 2.30753 (* x 0.27061)) (+ 1 (* (+ 0.99229 (* x 0.04481)) x)))))