Average Error: 0.1 → 0.1
Time: 39.3s
Precision: 64
\[1.0 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
\[1.0 - x \cdot \mathsf{fma}\left(0.12, x, 0.253\right)\]
1.0 - x \cdot \left(0.253 + x \cdot 0.12\right)
1.0 - x \cdot \mathsf{fma}\left(0.12, x, 0.253\right)
double f(double x) {
        double r3456721 = 1.0;
        double r3456722 = x;
        double r3456723 = 0.253;
        double r3456724 = 0.12;
        double r3456725 = r3456722 * r3456724;
        double r3456726 = r3456723 + r3456725;
        double r3456727 = r3456722 * r3456726;
        double r3456728 = r3456721 - r3456727;
        return r3456728;
}

double f(double x) {
        double r3456729 = 1.0;
        double r3456730 = x;
        double r3456731 = 0.12;
        double r3456732 = 0.253;
        double r3456733 = fma(r3456731, r3456730, r3456732);
        double r3456734 = r3456730 * r3456733;
        double r3456735 = r3456729 - r3456734;
        return r3456735;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.1

    \[1.0 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
  2. Simplified0.1

    \[\leadsto \color{blue}{1.0 - x \cdot \mathsf{fma}\left(0.12, x, 0.253\right)}\]
  3. Final simplification0.1

    \[\leadsto 1.0 - x \cdot \mathsf{fma}\left(0.12, x, 0.253\right)\]

Reproduce

herbie shell --seed 2019165 +o rules:numerics
(FPCore (x)
  :name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, A"
  (- 1.0 (* x (+ 0.253 (* x 0.12)))))