Average Error: 0.1 → 0.1
Time: 12.3s
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 r78812 = 1.0;
        double r78813 = x;
        double r78814 = 0.253;
        double r78815 = 0.12;
        double r78816 = r78813 * r78815;
        double r78817 = r78814 + r78816;
        double r78818 = r78813 * r78817;
        double r78819 = r78812 - r78818;
        return r78819;
}

double f(double x) {
        double r78820 = 1.0;
        double r78821 = 0.12;
        double r78822 = x;
        double r78823 = 0.253;
        double r78824 = fma(r78821, r78822, r78823);
        double r78825 = r78824 * r78822;
        double r78826 = r78820 - r78825;
        return r78826;
}

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