Average Error: 0.1 → 0.1
Time: 9.3s
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 r101832 = 1.0;
        double r101833 = x;
        double r101834 = 0.253;
        double r101835 = 0.12;
        double r101836 = r101833 * r101835;
        double r101837 = r101834 + r101836;
        double r101838 = r101833 * r101837;
        double r101839 = r101832 - r101838;
        return r101839;
}

double f(double x) {
        double r101840 = 1.0;
        double r101841 = 0.12;
        double r101842 = x;
        double r101843 = 0.253;
        double r101844 = fma(r101841, r101842, r101843);
        double r101845 = r101844 * r101842;
        double r101846 = r101840 - r101845;
        return r101846;
}

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