Average Error: 0.1 → 0.1
Time: 7.8s
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 r74905 = 1.0;
        double r74906 = x;
        double r74907 = 0.253;
        double r74908 = 0.12;
        double r74909 = r74906 * r74908;
        double r74910 = r74907 + r74909;
        double r74911 = r74906 * r74910;
        double r74912 = r74905 - r74911;
        return r74912;
}

double f(double x) {
        double r74913 = 1.0;
        double r74914 = 0.12;
        double r74915 = x;
        double r74916 = 0.253;
        double r74917 = fma(r74914, r74915, r74916);
        double r74918 = r74917 * r74915;
        double r74919 = r74913 - r74918;
        return r74919;
}

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