Average Error: 0.1 → 0.1
Time: 10.1s
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 r210976 = 1.0;
        double r210977 = x;
        double r210978 = 0.253;
        double r210979 = 0.12;
        double r210980 = r210977 * r210979;
        double r210981 = r210978 + r210980;
        double r210982 = r210977 * r210981;
        double r210983 = r210976 - r210982;
        return r210983;
}

double f(double x) {
        double r210984 = 1.0;
        double r210985 = 0.12;
        double r210986 = x;
        double r210987 = 0.253;
        double r210988 = fma(r210985, r210986, r210987);
        double r210989 = r210988 * r210986;
        double r210990 = r210984 - r210989;
        return r210990;
}

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