Average Error: 0.1 → 0.1
Time: 22.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 r3465021 = 1.0;
        double r3465022 = x;
        double r3465023 = 0.253;
        double r3465024 = 0.12;
        double r3465025 = r3465022 * r3465024;
        double r3465026 = r3465023 + r3465025;
        double r3465027 = r3465022 * r3465026;
        double r3465028 = r3465021 - r3465027;
        return r3465028;
}

double f(double x) {
        double r3465029 = 1.0;
        double r3465030 = x;
        double r3465031 = 0.12;
        double r3465032 = 0.253;
        double r3465033 = fma(r3465031, r3465030, r3465032);
        double r3465034 = r3465030 * r3465033;
        double r3465035 = r3465029 - r3465034;
        return r3465035;
}

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