Average Error: 0.1 → 0.1
Time: 9.6s
Precision: 64
\[1 - x \cdot \left(0.2530000000000000026645352591003756970167 + x \cdot 0.1199999999999999955591079014993738383055\right)\]
\[1 - x \cdot \mathsf{fma}\left(x, 0.1199999999999999955591079014993738383055, 0.2530000000000000026645352591003756970167\right)\]
1 - x \cdot \left(0.2530000000000000026645352591003756970167 + x \cdot 0.1199999999999999955591079014993738383055\right)
1 - x \cdot \mathsf{fma}\left(x, 0.1199999999999999955591079014993738383055, 0.2530000000000000026645352591003756970167\right)
double f(double x) {
        double r50020 = 1.0;
        double r50021 = x;
        double r50022 = 0.253;
        double r50023 = 0.12;
        double r50024 = r50021 * r50023;
        double r50025 = r50022 + r50024;
        double r50026 = r50021 * r50025;
        double r50027 = r50020 - r50026;
        return r50027;
}

double f(double x) {
        double r50028 = 1.0;
        double r50029 = x;
        double r50030 = 0.12;
        double r50031 = 0.253;
        double r50032 = fma(r50029, r50030, r50031);
        double r50033 = r50029 * r50032;
        double r50034 = r50028 - r50033;
        return r50034;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.1

    \[1 - x \cdot \left(0.2530000000000000026645352591003756970167 + x \cdot 0.1199999999999999955591079014993738383055\right)\]
  2. Using strategy rm
  3. Applied distribute-lft-in0.1

    \[\leadsto 1 - \color{blue}{\left(x \cdot 0.2530000000000000026645352591003756970167 + x \cdot \left(x \cdot 0.1199999999999999955591079014993738383055\right)\right)}\]
  4. Simplified0.1

    \[\leadsto 1 - \left(\color{blue}{0.2530000000000000026645352591003756970167 \cdot x} + x \cdot \left(x \cdot 0.1199999999999999955591079014993738383055\right)\right)\]
  5. Simplified0.2

    \[\leadsto 1 - \left(0.2530000000000000026645352591003756970167 \cdot x + \color{blue}{\left(x \cdot x\right) \cdot 0.1199999999999999955591079014993738383055}\right)\]
  6. Taylor expanded around 0 0.2

    \[\leadsto 1 - \color{blue}{\left(0.2530000000000000026645352591003756970167 \cdot x + 0.1199999999999999955591079014993738383055 \cdot {x}^{2}\right)}\]
  7. Simplified0.1

    \[\leadsto 1 - \color{blue}{x \cdot \mathsf{fma}\left(x, 0.1199999999999999955591079014993738383055, 0.2530000000000000026645352591003756970167\right)}\]
  8. Final simplification0.1

    \[\leadsto 1 - x \cdot \mathsf{fma}\left(x, 0.1199999999999999955591079014993738383055, 0.2530000000000000026645352591003756970167\right)\]

Reproduce

herbie shell --seed 2019196 +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)))))