Average Error: 0.0 → 0.1
Time: 13.5s
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{log1p}\left(\sqrt[3]{\left(\mathsf{fma}\left(x, \mathsf{fma}\left(0.04481, x, 0.99229\right), 1.0\right) \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(0.04481, x, 0.99229\right), 1.0\right)\right) \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(0.04481, x, 0.99229\right), 1.0\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{log1p}\left(\sqrt[3]{\left(\mathsf{fma}\left(x, \mathsf{fma}\left(0.04481, x, 0.99229\right), 1.0\right) \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(0.04481, x, 0.99229\right), 1.0\right)\right) \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(0.04481, x, 0.99229\right), 1.0\right)}\right)\right)}
double f(double x) {
        double r4509873 = x;
        double r4509874 = 2.30753;
        double r4509875 = 0.27061;
        double r4509876 = r4509873 * r4509875;
        double r4509877 = r4509874 + r4509876;
        double r4509878 = 1.0;
        double r4509879 = 0.99229;
        double r4509880 = 0.04481;
        double r4509881 = r4509873 * r4509880;
        double r4509882 = r4509879 + r4509881;
        double r4509883 = r4509882 * r4509873;
        double r4509884 = r4509878 + r4509883;
        double r4509885 = r4509877 / r4509884;
        double r4509886 = r4509873 - r4509885;
        return r4509886;
}

double f(double x) {
        double r4509887 = x;
        double r4509888 = 0.27061;
        double r4509889 = 2.30753;
        double r4509890 = fma(r4509888, r4509887, r4509889);
        double r4509891 = 0.04481;
        double r4509892 = 0.99229;
        double r4509893 = fma(r4509891, r4509887, r4509892);
        double r4509894 = 1.0;
        double r4509895 = fma(r4509887, r4509893, r4509894);
        double r4509896 = r4509895 * r4509895;
        double r4509897 = r4509896 * r4509895;
        double r4509898 = cbrt(r4509897);
        double r4509899 = log1p(r4509898);
        double r4509900 = expm1(r4509899);
        double r4509901 = r4509890 / r4509900;
        double r4509902 = r4509887 - r4509901;
        return r4509902;
}

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(x, \mathsf{fma}\left(0.04481, x, 0.99229\right), 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(x, \mathsf{fma}\left(0.04481, x, 0.99229\right), 1.0\right)\right)\right)}}\]
  5. Using strategy rm
  6. Applied add-cbrt-cube0.1

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

    \[\leadsto x - \frac{\mathsf{fma}\left(0.27061, x, 2.30753\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\sqrt[3]{\left(\mathsf{fma}\left(x, \mathsf{fma}\left(0.04481, x, 0.99229\right), 1.0\right) \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(0.04481, x, 0.99229\right), 1.0\right)\right) \cdot \mathsf{fma}\left(x, \mathsf{fma}\left(0.04481, x, 0.99229\right), 1.0\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)))))