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 r5283741 = x;
        double r5283742 = 2.30753;
        double r5283743 = 0.27061;
        double r5283744 = r5283741 * r5283743;
        double r5283745 = r5283742 + r5283744;
        double r5283746 = 1.0;
        double r5283747 = 0.99229;
        double r5283748 = 0.04481;
        double r5283749 = r5283741 * r5283748;
        double r5283750 = r5283747 + r5283749;
        double r5283751 = r5283750 * r5283741;
        double r5283752 = r5283746 + r5283751;
        double r5283753 = r5283745 / r5283752;
        double r5283754 = r5283741 - r5283753;
        return r5283754;
}

double f(double x) {
        double r5283755 = x;
        double r5283756 = 0.27061;
        double r5283757 = 2.30753;
        double r5283758 = fma(r5283756, r5283755, r5283757);
        double r5283759 = 0.04481;
        double r5283760 = 0.99229;
        double r5283761 = fma(r5283759, r5283755, r5283760);
        double r5283762 = 1.0;
        double r5283763 = fma(r5283761, r5283755, r5283762);
        double r5283764 = log1p(r5283763);
        double r5283765 = log1p(r5283764);
        double r5283766 = expm1(r5283765);
        double r5283767 = expm1(r5283766);
        double r5283768 = r5283758 / r5283767;
        double r5283769 = r5283755 - r5283768;
        return r5283769;
}

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