Average Error: 0.0 → 0.1
Time: 7.1s
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 r69974 = 2.30753;
        double r69975 = x;
        double r69976 = 0.27061;
        double r69977 = r69975 * r69976;
        double r69978 = r69974 + r69977;
        double r69979 = 1.0;
        double r69980 = 0.99229;
        double r69981 = 0.04481;
        double r69982 = r69975 * r69981;
        double r69983 = r69980 + r69982;
        double r69984 = r69975 * r69983;
        double r69985 = r69979 + r69984;
        double r69986 = r69978 / r69985;
        double r69987 = r69986 - r69975;
        return r69987;
}

double f(double x) {
        double r69988 = x;
        double r69989 = 0.27061;
        double r69990 = 2.30753;
        double r69991 = fma(r69988, r69989, r69990);
        double r69992 = 0.04481;
        double r69993 = 0.99229;
        double r69994 = fma(r69992, r69988, r69993);
        double r69995 = 1.0;
        double r69996 = fma(r69988, r69994, r69995);
        double r69997 = log1p(r69996);
        double r69998 = expm1(r69997);
        double r69999 = r69991 / r69998;
        double r70000 = r69999 - r69988;
        return r70000;
}

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))