Average Error: 0.0 → 0.1
Time: 11.8s
Precision: 64
\[\frac{2.30753 + x \cdot 0.27061}{1.0 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x\]
\[\frac{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481, 0.99229\right), x, 1.0\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481, 0.99229\right), x, 1.0\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481, 0.99229\right), x, 1.0\right)}\right)\right)} - x\]
\frac{2.30753 + x \cdot 0.27061}{1.0 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x
\frac{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481, 0.99229\right), x, 1.0\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481, 0.99229\right), x, 1.0\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481, 0.99229\right), x, 1.0\right)}\right)\right)} - x
double f(double x) {
        double r3445007 = 2.30753;
        double r3445008 = x;
        double r3445009 = 0.27061;
        double r3445010 = r3445008 * r3445009;
        double r3445011 = r3445007 + r3445010;
        double r3445012 = 1.0;
        double r3445013 = 0.99229;
        double r3445014 = 0.04481;
        double r3445015 = r3445008 * r3445014;
        double r3445016 = r3445013 + r3445015;
        double r3445017 = r3445008 * r3445016;
        double r3445018 = r3445012 + r3445017;
        double r3445019 = r3445011 / r3445018;
        double r3445020 = r3445019 - r3445008;
        return r3445020;
}

double f(double x) {
        double r3445021 = x;
        double r3445022 = 0.27061;
        double r3445023 = 2.30753;
        double r3445024 = fma(r3445021, r3445022, r3445023);
        double r3445025 = 0.04481;
        double r3445026 = 0.99229;
        double r3445027 = fma(r3445021, r3445025, r3445026);
        double r3445028 = 1.0;
        double r3445029 = fma(r3445027, r3445021, r3445028);
        double r3445030 = r3445029 * r3445029;
        double r3445031 = r3445030 * r3445029;
        double r3445032 = cbrt(r3445031);
        double r3445033 = log1p(r3445032);
        double r3445034 = expm1(r3445033);
        double r3445035 = r3445024 / r3445034;
        double r3445036 = r3445035 - r3445021;
        return r3445036;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[\frac{2.30753 + x \cdot 0.27061}{1.0 + x \cdot \left(0.99229 + x \cdot 0.04481\right)} - x\]
  2. Simplified0.0

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}{\mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481, 0.99229\right), x, 1.0\right)} - x}\]
  3. Using strategy rm
  4. Applied expm1-log1p-u0.1

    \[\leadsto \frac{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481, 0.99229\right), x, 1.0\right)\right)\right)}} - x\]
  5. Using strategy rm
  6. Applied add-cbrt-cube0.1

    \[\leadsto \frac{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\color{blue}{\sqrt[3]{\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481, 0.99229\right), x, 1.0\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481, 0.99229\right), x, 1.0\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481, 0.99229\right), x, 1.0\right)}}\right)\right)} - x\]
  7. Final simplification0.1

    \[\leadsto \frac{\mathsf{fma}\left(x, 0.27061, 2.30753\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\left(\mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481, 0.99229\right), x, 1.0\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481, 0.99229\right), x, 1.0\right)\right) \cdot \mathsf{fma}\left(\mathsf{fma}\left(x, 0.04481, 0.99229\right), x, 1.0\right)}\right)\right)} - x\]

Reproduce

herbie shell --seed 2019163 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, C"
  (- (/ (+ 2.30753 (* x 0.27061)) (+ 1.0 (* x (+ 0.99229 (* x 0.04481))))) x))