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 r90065 = 1.0;
        double r90066 = x;
        double r90067 = 0.253;
        double r90068 = 0.12;
        double r90069 = r90066 * r90068;
        double r90070 = r90067 + r90069;
        double r90071 = r90066 * r90070;
        double r90072 = r90065 - r90071;
        return r90072;
}

double f(double x) {
        double r90073 = 1.0;
        double r90074 = 0.12;
        double r90075 = x;
        double r90076 = 0.253;
        double r90077 = fma(r90074, r90075, r90076);
        double r90078 = r90077 * r90075;
        double r90079 = r90073 - r90078;
        return r90079;
}

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