Average Error: 0.1 → 0.1
Time: 9.7s
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 r79602 = 1.0;
        double r79603 = x;
        double r79604 = 0.253;
        double r79605 = 0.12;
        double r79606 = r79603 * r79605;
        double r79607 = r79604 + r79606;
        double r79608 = r79603 * r79607;
        double r79609 = r79602 - r79608;
        return r79609;
}

double f(double x) {
        double r79610 = 1.0;
        double r79611 = 0.12;
        double r79612 = x;
        double r79613 = 0.253;
        double r79614 = fma(r79611, r79612, r79613);
        double r79615 = r79614 * r79612;
        double r79616 = r79610 - r79615;
        return r79616;
}

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