Average Error: 0.0 → 0.1
Time: 2.7s
Precision: 64
\[x - \frac{2.30753 + x \cdot 0.27061000000000002}{1 + \left(0.992290000000000005 + x \cdot 0.044810000000000003\right) \cdot x}\]
\[\frac{-\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)\right)\right)} + x\]
x - \frac{2.30753 + x \cdot 0.27061000000000002}{1 + \left(0.992290000000000005 + x \cdot 0.044810000000000003\right) \cdot x}
\frac{-\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{expm1}\left(\mathsf{log1p}\left(\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)\right)\right)} + x
double f(double x) {
        double r114640 = x;
        double r114641 = 2.30753;
        double r114642 = 0.27061;
        double r114643 = r114640 * r114642;
        double r114644 = r114641 + r114643;
        double r114645 = 1.0;
        double r114646 = 0.99229;
        double r114647 = 0.04481;
        double r114648 = r114640 * r114647;
        double r114649 = r114646 + r114648;
        double r114650 = r114649 * r114640;
        double r114651 = r114645 + r114650;
        double r114652 = r114644 / r114651;
        double r114653 = r114640 - r114652;
        return r114653;
}

double f(double x) {
        double r114654 = 0.27061;
        double r114655 = x;
        double r114656 = 2.30753;
        double r114657 = fma(r114654, r114655, r114656);
        double r114658 = -r114657;
        double r114659 = 0.04481;
        double r114660 = 0.99229;
        double r114661 = fma(r114659, r114655, r114660);
        double r114662 = 1.0;
        double r114663 = fma(r114655, r114661, r114662);
        double r114664 = log1p(r114663);
        double r114665 = expm1(r114664);
        double r114666 = r114658 / r114665;
        double r114667 = r114666 + r114655;
        return r114667;
}

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}{\frac{-\mathsf{fma}\left(0.27061000000000002, x, 2.30753\right)}{\mathsf{fma}\left(x, \mathsf{fma}\left(0.044810000000000003, x, 0.992290000000000005\right), 1\right)} + x}\]
  3. Using strategy rm
  4. Applied expm1-log1p-u0.1

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

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

Reproduce

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