Average Error: 0.1 → 0.2
Time: 1.6s
Precision: 64
\[1 - x \cdot \left(0.2530000000000000026645352591003756970167 + x \cdot 0.1199999999999999955591079014993738383055\right)\]
\[0.1199999999999999955591079014993738383055 \cdot \left(x \cdot \left(-x\right)\right) + \mathsf{fma}\left(0.2530000000000000026645352591003756970167, -x, 1\right)\]
1 - x \cdot \left(0.2530000000000000026645352591003756970167 + x \cdot 0.1199999999999999955591079014993738383055\right)
0.1199999999999999955591079014993738383055 \cdot \left(x \cdot \left(-x\right)\right) + \mathsf{fma}\left(0.2530000000000000026645352591003756970167, -x, 1\right)
double f(double x) {
        double r54812 = 1.0;
        double r54813 = x;
        double r54814 = 0.253;
        double r54815 = 0.12;
        double r54816 = r54813 * r54815;
        double r54817 = r54814 + r54816;
        double r54818 = r54813 * r54817;
        double r54819 = r54812 - r54818;
        return r54819;
}

double f(double x) {
        double r54820 = 0.12;
        double r54821 = x;
        double r54822 = -r54821;
        double r54823 = r54821 * r54822;
        double r54824 = r54820 * r54823;
        double r54825 = 0.253;
        double r54826 = 1.0;
        double r54827 = fma(r54825, r54822, r54826);
        double r54828 = r54824 + r54827;
        return r54828;
}

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. Using strategy rm
  11. Applied associate-*l*0.2

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

    \[\leadsto 0.1199999999999999955591079014993738383055 \cdot \left(x \cdot \left(-x\right)\right) + \mathsf{fma}\left(0.2530000000000000026645352591003756970167, -x, 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)))))