Average Error: 0.0 → 0.1
Time: 6.2s
Precision: 64
\[x - \frac{2.30753 + x \cdot 0.27061000000000002}{1 + \left(0.992290000000000005 + x \cdot 0.044810000000000003\right) \cdot x}\]
\[x - \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(x, 0.27061000000000002, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\right)\]
x - \frac{2.30753 + x \cdot 0.27061000000000002}{1 + \left(0.992290000000000005 + x \cdot 0.044810000000000003\right) \cdot x}
x - \mathsf{expm1}\left(\mathsf{log1p}\left(\frac{\mathsf{fma}\left(x, 0.27061000000000002, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)}\right)\right)
double f(double x) {
        double r86539 = x;
        double r86540 = 2.30753;
        double r86541 = 0.27061;
        double r86542 = r86539 * r86541;
        double r86543 = r86540 + r86542;
        double r86544 = 1.0;
        double r86545 = 0.99229;
        double r86546 = 0.04481;
        double r86547 = r86539 * r86546;
        double r86548 = r86545 + r86547;
        double r86549 = r86548 * r86539;
        double r86550 = r86544 + r86549;
        double r86551 = r86543 / r86550;
        double r86552 = r86539 - r86551;
        return r86552;
}

double f(double x) {
        double r86553 = x;
        double r86554 = 0.27061;
        double r86555 = 2.30753;
        double r86556 = fma(r86553, r86554, r86555);
        double r86557 = 0.04481;
        double r86558 = 0.99229;
        double r86559 = fma(r86557, r86553, r86558);
        double r86560 = 1.0;
        double r86561 = fma(r86553, r86559, r86560);
        double r86562 = r86556 / r86561;
        double r86563 = log1p(r86562);
        double r86564 = expm1(r86563);
        double r86565 = r86553 - r86564;
        return r86565;
}

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. Using strategy rm
  3. Applied expm1-log1p-u0.1

    \[\leadsto x - \color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{2.30753 + x \cdot 0.27061000000000002}{1 + \left(0.992290000000000005 + x \cdot 0.044810000000000003\right) \cdot x}\right)\right)}\]
  4. Simplified0.1

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

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

Reproduce

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