Average Error: 0.0 → 0.1
Time: 12.8s
Precision: 64
\[x - \frac{2.307529999999999859028321225196123123169 + x \cdot 0.2706100000000000171951342053944244980812}{1 + \left(0.992290000000000005364597654988756403327 + x \cdot 0.04481000000000000260680366181986755691469\right) \cdot x}\]
\[x - \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(x, 0.2706100000000000171951342053944244980812, 2.307529999999999859028321225196123123169\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.04481000000000000260680366181986755691469, x, 0.992290000000000005364597654988756403327\right), x, 1\right)\right)\right)}\right)\right)\]
x - \frac{2.307529999999999859028321225196123123169 + x \cdot 0.2706100000000000171951342053944244980812}{1 + \left(0.992290000000000005364597654988756403327 + x \cdot 0.04481000000000000260680366181986755691469\right) \cdot x}
x - \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(x, 0.2706100000000000171951342053944244980812, 2.307529999999999859028321225196123123169\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.04481000000000000260680366181986755691469, x, 0.992290000000000005364597654988756403327\right), x, 1\right)\right)\right)}\right)\right)
double f(double x) {
        double r105189 = x;
        double r105190 = 2.30753;
        double r105191 = 0.27061;
        double r105192 = r105189 * r105191;
        double r105193 = r105190 + r105192;
        double r105194 = 1.0;
        double r105195 = 0.99229;
        double r105196 = 0.04481;
        double r105197 = r105189 * r105196;
        double r105198 = r105195 + r105197;
        double r105199 = r105198 * r105189;
        double r105200 = r105194 + r105199;
        double r105201 = r105193 / r105200;
        double r105202 = r105189 - r105201;
        return r105202;
}

double f(double x) {
        double r105203 = x;
        double r105204 = 0.27061;
        double r105205 = 2.30753;
        double r105206 = fma(r105203, r105204, r105205);
        double r105207 = 0.04481;
        double r105208 = 0.99229;
        double r105209 = fma(r105207, r105203, r105208);
        double r105210 = 1.0;
        double r105211 = fma(r105209, r105203, r105210);
        double r105212 = log1p(r105211);
        double r105213 = expm1(r105212);
        double r105214 = r105206 / r105213;
        double r105215 = log1p(r105214);
        double r105216 = expm1(r105215);
        double r105217 = r105203 - r105216;
        return r105217;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

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

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

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

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

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

Reproduce

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