Average Error: 0.1 → 0.1
Time: 2.4s
Precision: 64
\[1 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
\[1 - x \cdot \mathsf{fma}\left(0.12, x, 0.253\right)\]
1 - x \cdot \left(0.253 + x \cdot 0.12\right)
1 - x \cdot \mathsf{fma}\left(0.12, x, 0.253\right)
double f(double x) {
        double r49959 = 1.0;
        double r49960 = x;
        double r49961 = 0.253;
        double r49962 = 0.12;
        double r49963 = r49960 * r49962;
        double r49964 = r49961 + r49963;
        double r49965 = r49960 * r49964;
        double r49966 = r49959 - r49965;
        return r49966;
}

double f(double x) {
        double r49967 = 1.0;
        double r49968 = x;
        double r49969 = 0.12;
        double r49970 = 0.253;
        double r49971 = fma(r49969, r49968, r49970);
        double r49972 = r49968 * r49971;
        double r49973 = r49967 - r49972;
        return r49973;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.1

    \[1 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
  2. Taylor expanded around 0 0.1

    \[\leadsto 1 - \color{blue}{\left(0.12 \cdot {x}^{2} + 0.253 \cdot x\right)}\]
  3. Simplified0.1

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

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

Reproduce

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