Average Error: 0.0 → 0.1
Time: 3.6s
Precision: 64
\[\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)} - x\]
\[\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(x, 0.27061000000000002, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\right) - x\]
\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)} - x
\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(x, 0.27061000000000002, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\right) - x
double f(double x) {
        double r62875 = 2.30753;
        double r62876 = x;
        double r62877 = 0.27061;
        double r62878 = r62876 * r62877;
        double r62879 = r62875 + r62878;
        double r62880 = 1.0;
        double r62881 = 0.99229;
        double r62882 = 0.04481;
        double r62883 = r62876 * r62882;
        double r62884 = r62881 + r62883;
        double r62885 = r62876 * r62884;
        double r62886 = r62880 + r62885;
        double r62887 = r62879 / r62886;
        double r62888 = r62887 - r62876;
        return r62888;
}

double f(double x) {
        double r62889 = x;
        double r62890 = 0.27061;
        double r62891 = 2.30753;
        double r62892 = fma(r62889, r62890, r62891);
        double r62893 = 0.04481;
        double r62894 = 0.99229;
        double r62895 = fma(r62893, r62889, r62894);
        double r62896 = 1.0;
        double r62897 = fma(r62889, r62895, r62896);
        double r62898 = r62892 / r62897;
        double r62899 = log1p(r62898);
        double r62900 = expm1(r62899);
        double r62901 = r62900 - r62889;
        return r62901;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

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

    \[\leadsto \color{blue}{\frac{\mathsf{fma}\left(x, 0.27061000000000002, 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 \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(x, 0.27061000000000002, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\right)} - x\]
  5. Final simplification0.1

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

Reproduce

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