Average Error: 0.1 → 0.1
Time: 1.5s
Precision: 64
\[1 - x \cdot \left(0.2530000000000000026645352591003756970167 + x \cdot 0.1199999999999999955591079014993738383055\right)\]
\[\mathsf{fma}\left(-x, \mathsf{fma}\left(0.1199999999999999955591079014993738383055, x, 0.2530000000000000026645352591003756970167\right), 1\right)\]
1 - x \cdot \left(0.2530000000000000026645352591003756970167 + x \cdot 0.1199999999999999955591079014993738383055\right)
\mathsf{fma}\left(-x, \mathsf{fma}\left(0.1199999999999999955591079014993738383055, x, 0.2530000000000000026645352591003756970167\right), 1\right)
double f(double x) {
        double r72113 = 1.0;
        double r72114 = x;
        double r72115 = 0.253;
        double r72116 = 0.12;
        double r72117 = r72114 * r72116;
        double r72118 = r72115 + r72117;
        double r72119 = r72114 * r72118;
        double r72120 = r72113 - r72119;
        return r72120;
}

double f(double x) {
        double r72121 = x;
        double r72122 = -r72121;
        double r72123 = 0.12;
        double r72124 = 0.253;
        double r72125 = fma(r72123, r72121, r72124);
        double r72126 = 1.0;
        double r72127 = fma(r72122, r72125, r72126);
        return r72127;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.1

    \[1 - x \cdot \left(0.2530000000000000026645352591003756970167 + x \cdot 0.1199999999999999955591079014993738383055\right)\]
  2. Simplified0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \mathsf{fma}\left(0.1199999999999999955591079014993738383055, x, 0.2530000000000000026645352591003756970167\right), 1\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.1

    \[\leadsto \color{blue}{\left(-x\right) \cdot \mathsf{fma}\left(0.1199999999999999955591079014993738383055, x, 0.2530000000000000026645352591003756970167\right) + 1}\]
  5. Using strategy rm
  6. Applied fma-udef0.1

    \[\leadsto \left(-x\right) \cdot \color{blue}{\left(0.1199999999999999955591079014993738383055 \cdot x + 0.2530000000000000026645352591003756970167\right)} + 1\]
  7. Applied distribute-rgt-in0.1

    \[\leadsto \color{blue}{\left(\left(0.1199999999999999955591079014993738383055 \cdot x\right) \cdot \left(-x\right) + 0.2530000000000000026645352591003756970167 \cdot \left(-x\right)\right)} + 1\]
  8. Applied associate-+l+0.1

    \[\leadsto \color{blue}{\left(0.1199999999999999955591079014993738383055 \cdot x\right) \cdot \left(-x\right) + \left(0.2530000000000000026645352591003756970167 \cdot \left(-x\right) + 1\right)}\]
  9. Simplified0.1

    \[\leadsto \left(0.1199999999999999955591079014993738383055 \cdot x\right) \cdot \left(-x\right) + \color{blue}{\mathsf{fma}\left(0.2530000000000000026645352591003756970167, -x, 1\right)}\]
  10. Taylor expanded around 0 0.2

    \[\leadsto \color{blue}{1 - \left(0.1199999999999999955591079014993738383055 \cdot {x}^{2} + 0.2530000000000000026645352591003756970167 \cdot x\right)}\]
  11. Simplified0.1

    \[\leadsto \color{blue}{\mathsf{fma}\left(-x, \mathsf{fma}\left(0.1199999999999999955591079014993738383055, x, 0.2530000000000000026645352591003756970167\right), 1\right)}\]
  12. Final simplification0.1

    \[\leadsto \mathsf{fma}\left(-x, \mathsf{fma}\left(0.1199999999999999955591079014993738383055, x, 0.2530000000000000026645352591003756970167\right), 1\right)\]

Reproduce

herbie shell --seed 2020001 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, A"
  :precision binary64
  (- 1 (* x (+ 0.253 (* x 0.12)))))