Average Error: 0.1 → 0.1
Time: 7.6s
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 r86907 = 1.0;
        double r86908 = x;
        double r86909 = 0.253;
        double r86910 = 0.12;
        double r86911 = r86908 * r86910;
        double r86912 = r86909 + r86911;
        double r86913 = r86908 * r86912;
        double r86914 = r86907 - r86913;
        return r86914;
}

double f(double x) {
        double r86915 = 1.0;
        double r86916 = 0.12;
        double r86917 = x;
        double r86918 = 0.253;
        double r86919 = fma(r86916, r86917, r86918);
        double r86920 = r86919 * r86917;
        double r86921 = r86915 - r86920;
        return r86921;
}

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