Average Error: 0.1 → 0.1
Time: 10.4s
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 r78561 = 1.0;
        double r78562 = x;
        double r78563 = 0.253;
        double r78564 = 0.12;
        double r78565 = r78562 * r78564;
        double r78566 = r78563 + r78565;
        double r78567 = r78562 * r78566;
        double r78568 = r78561 - r78567;
        return r78568;
}

double f(double x) {
        double r78569 = 1.0;
        double r78570 = 0.12;
        double r78571 = x;
        double r78572 = 0.253;
        double r78573 = fma(r78570, r78571, r78572);
        double r78574 = r78573 * r78571;
        double r78575 = r78569 - r78574;
        return r78575;
}

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 2020042 +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)))))