Average Error: 0.0 → 0.1
Time: 5.6s
Precision: 64
\[\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)} - x\]
\[\frac{\mathsf{fma}\left(x, 0.27061000000000002, 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\]
\frac{2.30753 + x \cdot 0.27061000000000002}{1 + x \cdot \left(0.992290000000000005 + x \cdot 0.044810000000000003\right)} - x
\frac{\mathsf{fma}\left(x, 0.27061000000000002, 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 r76727 = 2.30753;
        double r76728 = x;
        double r76729 = 0.27061;
        double r76730 = r76728 * r76729;
        double r76731 = r76727 + r76730;
        double r76732 = 1.0;
        double r76733 = 0.99229;
        double r76734 = 0.04481;
        double r76735 = r76728 * r76734;
        double r76736 = r76733 + r76735;
        double r76737 = r76728 * r76736;
        double r76738 = r76732 + r76737;
        double r76739 = r76731 / r76738;
        double r76740 = r76739 - r76728;
        return r76740;
}

double f(double x) {
        double r76741 = x;
        double r76742 = 0.27061;
        double r76743 = 2.30753;
        double r76744 = fma(r76741, r76742, r76743);
        double r76745 = 0.04481;
        double r76746 = 0.99229;
        double r76747 = fma(r76745, r76741, r76746);
        double r76748 = 1.0;
        double r76749 = fma(r76741, r76747, r76748);
        double r76750 = log1p(r76749);
        double r76751 = expm1(r76750);
        double r76752 = r76744 / r76751;
        double r76753 = r76752 - r76741;
        return r76753;
}

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 \frac{\mathsf{fma}\left(x, 0.27061000000000002, 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(x, 0.27061000000000002, 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 2020045 +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))