Average Error: 0.0 → 0.1
Time: 20.2s
Precision: 64
\[x - \frac{2.30753 + x \cdot 0.27061}{1.0 + \left(0.99229 + x \cdot 0.04481\right) \cdot x}\]
\[x - \frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\mathsf{expm1}\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.04481, x, 0.99229\right), x, 1.0\right)\right)\right)\right)\right)}\]
x - \frac{2.30753 + x \cdot 0.27061}{1.0 + \left(0.99229 + x \cdot 0.04481\right) \cdot x}
x - \frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\mathsf{expm1}\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.04481, x, 0.99229\right), x, 1.0\right)\right)\right)\right)\right)}
double f(double x) {
        double r5208978 = x;
        double r5208979 = 2.30753;
        double r5208980 = 0.27061;
        double r5208981 = r5208978 * r5208980;
        double r5208982 = r5208979 + r5208981;
        double r5208983 = 1.0;
        double r5208984 = 0.99229;
        double r5208985 = 0.04481;
        double r5208986 = r5208978 * r5208985;
        double r5208987 = r5208984 + r5208986;
        double r5208988 = r5208987 * r5208978;
        double r5208989 = r5208983 + r5208988;
        double r5208990 = r5208982 / r5208989;
        double r5208991 = r5208978 - r5208990;
        return r5208991;
}

double f(double x) {
        double r5208992 = x;
        double r5208993 = 0.27061;
        double r5208994 = 2.30753;
        double r5208995 = fma(r5208993, r5208992, r5208994);
        double r5208996 = 0.04481;
        double r5208997 = 0.99229;
        double r5208998 = fma(r5208996, r5208992, r5208997);
        double r5208999 = 1.0;
        double r5209000 = fma(r5208998, r5208992, r5208999);
        double r5209001 = log1p(r5209000);
        double r5209002 = log1p(r5209001);
        double r5209003 = expm1(r5209002);
        double r5209004 = expm1(r5209003);
        double r5209005 = r5208995 / r5209004;
        double r5209006 = r5208992 - r5209005;
        return r5209006;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[x - \frac{2.30753 + x \cdot 0.27061}{1.0 + \left(0.99229 + x \cdot 0.04481\right) \cdot x}\]
  2. Simplified0.0

    \[\leadsto \color{blue}{x - \frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\mathsf{fma}\left(\mathsf{fma}\left(0.04481, x, 0.99229\right), x, 1.0\right)}}\]
  3. Using strategy rm
  4. Applied expm1-log1p-u0.1

    \[\leadsto x - \frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.04481, x, 0.99229\right), x, 1.0\right)\right)\right)}}\]
  5. Using strategy rm
  6. Applied expm1-log1p-u0.1

    \[\leadsto x - \frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\mathsf{expm1}\left(\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.04481, x, 0.99229\right), x, 1.0\right)\right)\right)\right)}\right)}\]
  7. Final simplification0.1

    \[\leadsto x - \frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\mathsf{expm1}\left(\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.04481, x, 0.99229\right), x, 1.0\right)\right)\right)\right)\right)}\]

Reproduce

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