Average Error: 0.1 → 0.1
Time: 11.0s
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 r1245152 = 1.0;
        double r1245153 = x;
        double r1245154 = 0.253;
        double r1245155 = 0.12;
        double r1245156 = r1245153 * r1245155;
        double r1245157 = r1245154 + r1245156;
        double r1245158 = r1245153 * r1245157;
        double r1245159 = r1245152 - r1245158;
        return r1245159;
}

double f(double x) {
        double r1245160 = 1.0;
        double r1245161 = x;
        double r1245162 = 0.12;
        double r1245163 = 0.253;
        double r1245164 = fma(r1245162, r1245161, r1245163);
        double r1245165 = r1245161 * r1245164;
        double r1245166 = r1245160 - r1245165;
        return r1245166;
}

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