Average Error: 0.0 → 0.1
Time: 9.5s
Precision: 64
\[x - \frac{2.30753 + x \cdot 0.27061000000000002}{1 + \left(0.992290000000000005 + x \cdot 0.044810000000000003\right) \cdot x}\]
\[x - \frac{\mathsf{fma}\left(x, 0.27061000000000002, 2.30753\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), x, 1\right)\right)\right)}\]
x - \frac{2.30753 + x \cdot 0.27061000000000002}{1 + \left(0.992290000000000005 + x \cdot 0.044810000000000003\right) \cdot x}
x - \frac{\mathsf{fma}\left(x, 0.27061000000000002, 2.30753\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), x, 1\right)\right)\right)}
double f(double x) {
        double r87542 = x;
        double r87543 = 2.30753;
        double r87544 = 0.27061;
        double r87545 = r87542 * r87544;
        double r87546 = r87543 + r87545;
        double r87547 = 1.0;
        double r87548 = 0.99229;
        double r87549 = 0.04481;
        double r87550 = r87542 * r87549;
        double r87551 = r87548 + r87550;
        double r87552 = r87551 * r87542;
        double r87553 = r87547 + r87552;
        double r87554 = r87546 / r87553;
        double r87555 = r87542 - r87554;
        return r87555;
}

double f(double x) {
        double r87556 = x;
        double r87557 = 0.27061;
        double r87558 = 2.30753;
        double r87559 = fma(r87556, r87557, r87558);
        double r87560 = 0.04481;
        double r87561 = 0.99229;
        double r87562 = fma(r87560, r87556, r87561);
        double r87563 = 1.0;
        double r87564 = fma(r87562, r87556, r87563);
        double r87565 = log1p(r87564);
        double r87566 = expm1(r87565);
        double r87567 = r87559 / r87566;
        double r87568 = r87556 - r87567;
        return r87568;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.0

    \[x - \frac{2.30753 + x \cdot 0.27061000000000002}{1 + \left(0.992290000000000005 + x \cdot 0.044810000000000003\right) \cdot x}\]
  2. Simplified0.0

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

    \[\leadsto x - \frac{\mathsf{fma}\left(x, 0.27061000000000002, 2.30753\right)}{\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), x, 1\right)\right)\right)}}\]
  5. Final simplification0.1

    \[\leadsto x - \frac{\mathsf{fma}\left(x, 0.27061000000000002, 2.30753\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(\mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), x, 1\right)\right)\right)}\]

Reproduce

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