Average Error: 0.1 → 0.1
Time: 12.9s
Precision: 64
\[1 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
\[1 - \mathsf{fma}\left(0.12, x, 0.253\right) \cdot x\]
1 - x \cdot \left(0.253 + x \cdot 0.12\right)
1 - \mathsf{fma}\left(0.12, x, 0.253\right) \cdot x
double f(double x) {
        double r91730 = 1.0;
        double r91731 = x;
        double r91732 = 0.253;
        double r91733 = 0.12;
        double r91734 = r91731 * r91733;
        double r91735 = r91732 + r91734;
        double r91736 = r91731 * r91735;
        double r91737 = r91730 - r91736;
        return r91737;
}

double f(double x) {
        double r91738 = 1.0;
        double r91739 = 0.12;
        double r91740 = x;
        double r91741 = 0.253;
        double r91742 = fma(r91739, r91740, r91741);
        double r91743 = r91742 * r91740;
        double r91744 = r91738 - r91743;
        return r91744;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.1

    \[1 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
  2. Simplified0.1

    \[\leadsto \color{blue}{1 - \mathsf{fma}\left(0.12, x, 0.253\right) \cdot x}\]
  3. Final simplification0.1

    \[\leadsto 1 - \mathsf{fma}\left(0.12, x, 0.253\right) \cdot x\]

Reproduce

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