Average Error: 0.0 → 0.1
Time: 7.7s
Precision: 64
\[\frac{2.307529999999999859028321225196123123169 + x \cdot 0.2706100000000000171951342053944244980812}{1 + x \cdot \left(0.992290000000000005364597654988756403327 + x \cdot 0.04481000000000000260680366181986755691469\right)} - x\]
\[\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(0.2706100000000000171951342053944244980812, x, 2.307529999999999859028321225196123123169\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(x, \mathsf{fma}\left(0.04481000000000000260680366181986755691469, x, 0.992290000000000005364597654988756403327\right), 1\right)\right)\right)}\right)\right) - x\]
\frac{2.307529999999999859028321225196123123169 + x \cdot 0.2706100000000000171951342053944244980812}{1 + x \cdot \left(0.992290000000000005364597654988756403327 + x \cdot 0.04481000000000000260680366181986755691469\right)} - x
\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(0.2706100000000000171951342053944244980812, x, 2.307529999999999859028321225196123123169\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(x, \mathsf{fma}\left(0.04481000000000000260680366181986755691469, x, 0.992290000000000005364597654988756403327\right), 1\right)\right)\right)}\right)\right) - x
double f(double x) {
        double r147234 = 2.30753;
        double r147235 = x;
        double r147236 = 0.27061;
        double r147237 = r147235 * r147236;
        double r147238 = r147234 + r147237;
        double r147239 = 1.0;
        double r147240 = 0.99229;
        double r147241 = 0.04481;
        double r147242 = r147235 * r147241;
        double r147243 = r147240 + r147242;
        double r147244 = r147235 * r147243;
        double r147245 = r147239 + r147244;
        double r147246 = r147238 / r147245;
        double r147247 = r147246 - r147235;
        return r147247;
}

double f(double x) {
        double r147248 = 0.27061;
        double r147249 = x;
        double r147250 = 2.30753;
        double r147251 = fma(r147248, r147249, r147250);
        double r147252 = 0.04481;
        double r147253 = 0.99229;
        double r147254 = fma(r147252, r147249, r147253);
        double r147255 = 1.0;
        double r147256 = fma(r147249, r147254, r147255);
        double r147257 = log1p(r147256);
        double r147258 = expm1(r147257);
        double r147259 = r147251 / r147258;
        double r147260 = log1p(r147259);
        double r147261 = expm1(r147260);
        double r147262 = r147261 - r147249;
        return r147262;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[\frac{2.307529999999999859028321225196123123169 + x \cdot 0.2706100000000000171951342053944244980812}{1 + x \cdot \left(0.992290000000000005364597654988756403327 + x \cdot 0.04481000000000000260680366181986755691469\right)} - x\]
  2. Using strategy rm
  3. Applied expm1-log1p-u0.0

    \[\leadsto \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2.307529999999999859028321225196123123169 + x \cdot 0.2706100000000000171951342053944244980812}{1 + x \cdot \left(0.992290000000000005364597654988756403327 + x \cdot 0.04481000000000000260680366181986755691469\right)}\right)\right)} - x\]
  4. Simplified0.0

    \[\leadsto \mathsf{expm1}\left(\color{blue}{\mathsf{log1p}\left(\frac{\mathsf{fma}\left(0.2706100000000000171951342053944244980812, x, 2.307529999999999859028321225196123123169\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.04481000000000000260680366181986755691469, x, 0.992290000000000005364597654988756403327\right), 1\right)}\right)}\right) - x\]
  5. Using strategy rm
  6. Applied expm1-log1p-u0.1

    \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(0.2706100000000000171951342053944244980812, x, 2.307529999999999859028321225196123123169\right)}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(x, \mathsf{fma}\left(0.04481000000000000260680366181986755691469, x, 0.992290000000000005364597654988756403327\right), 1\right)\right)\right)}}\right)\right) - x\]
  7. Final simplification0.1

    \[\leadsto \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(0.2706100000000000171951342053944244980812, x, 2.307529999999999859028321225196123123169\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(x, \mathsf{fma}\left(0.04481000000000000260680366181986755691469, x, 0.992290000000000005364597654988756403327\right), 1\right)\right)\right)}\right)\right) - x\]

Reproduce

herbie shell --seed 2019350 +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))