Average Error: 0.1 → 0.1
Time: 19.2s
Precision: 64
\[1.0 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
\[1.0 - \left(0.253 \cdot x + \left(0.12 \cdot x\right) \cdot x\right)\]
1.0 - x \cdot \left(0.253 + x \cdot 0.12\right)
1.0 - \left(0.253 \cdot x + \left(0.12 \cdot x\right) \cdot x\right)
double f(double x) {
        double r3285834 = 1.0;
        double r3285835 = x;
        double r3285836 = 0.253;
        double r3285837 = 0.12;
        double r3285838 = r3285835 * r3285837;
        double r3285839 = r3285836 + r3285838;
        double r3285840 = r3285835 * r3285839;
        double r3285841 = r3285834 - r3285840;
        return r3285841;
}

double f(double x) {
        double r3285842 = 1.0;
        double r3285843 = 0.253;
        double r3285844 = x;
        double r3285845 = r3285843 * r3285844;
        double r3285846 = 0.12;
        double r3285847 = r3285846 * r3285844;
        double r3285848 = r3285847 * r3285844;
        double r3285849 = r3285845 + r3285848;
        double r3285850 = r3285842 - r3285849;
        return r3285850;
}

Error

Bits error versus x

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

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. Using strategy rm
  4. Applied fma-udef0.1

    \[\leadsto 1.0 - x \cdot \color{blue}{\left(0.12 \cdot x + 0.253\right)}\]
  5. Applied distribute-lft-in0.1

    \[\leadsto 1.0 - \color{blue}{\left(x \cdot \left(0.12 \cdot x\right) + x \cdot 0.253\right)}\]
  6. Final simplification0.1

    \[\leadsto 1.0 - \left(0.253 \cdot x + \left(0.12 \cdot x\right) \cdot x\right)\]

Reproduce

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