Average Error: 0.1 → 0.1
Time: 2.8s
Precision: 64
\[1 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
\[\left(-x\right) \cdot \mathsf{fma}\left(0.12, x, 0.253\right) + 1\]
1 - x \cdot \left(0.253 + x \cdot 0.12\right)
\left(-x\right) \cdot \mathsf{fma}\left(0.12, x, 0.253\right) + 1
double f(double x) {
        double r83450 = 1.0;
        double r83451 = x;
        double r83452 = 0.253;
        double r83453 = 0.12;
        double r83454 = r83451 * r83453;
        double r83455 = r83452 + r83454;
        double r83456 = r83451 * r83455;
        double r83457 = r83450 - r83456;
        return r83457;
}

double f(double x) {
        double r83458 = x;
        double r83459 = -r83458;
        double r83460 = 0.12;
        double r83461 = 0.253;
        double r83462 = fma(r83460, r83458, r83461);
        double r83463 = r83459 * r83462;
        double r83464 = 1.0;
        double r83465 = r83463 + r83464;
        return r83465;
}

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}{\mathsf{fma}\left(-x, \mathsf{fma}\left(0.12, x, 0.253\right), 1\right)}\]
  3. Using strategy rm
  4. Applied fma-udef0.1

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

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

Reproduce

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