Average Error: 0.1 → 0.1
Time: 7.9s
Precision: 64
\[1 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
\[1 - x \cdot \mathsf{fma}\left(1, 0.253, x \cdot 0.12\right)\]
1 - x \cdot \left(0.253 + x \cdot 0.12\right)
1 - x \cdot \mathsf{fma}\left(1, 0.253, x \cdot 0.12\right)
double f(double x) {
        double r91966 = 1.0;
        double r91967 = x;
        double r91968 = 0.253;
        double r91969 = 0.12;
        double r91970 = r91967 * r91969;
        double r91971 = r91968 + r91970;
        double r91972 = r91967 * r91971;
        double r91973 = r91966 - r91972;
        return r91973;
}

double f(double x) {
        double r91974 = 1.0;
        double r91975 = x;
        double r91976 = 1.0;
        double r91977 = 0.253;
        double r91978 = 0.12;
        double r91979 = r91975 * r91978;
        double r91980 = fma(r91976, r91977, r91979);
        double r91981 = r91975 * r91980;
        double r91982 = r91974 - r91981;
        return r91982;
}

Error

Bits error versus x

Derivation

  1. Initial program 0.1

    \[1 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
  2. Using strategy rm
  3. Applied *-un-lft-identity0.1

    \[\leadsto 1 - x \cdot \left(\color{blue}{1 \cdot 0.253} + x \cdot 0.12\right)\]
  4. Applied fma-def0.1

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

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

Reproduce

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