Average Error: 0.1 → 0.1
Time: 2.5s
Precision: 64
\[1 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
\[\left(1 - 0.253 \cdot x\right) - \left(x \cdot 0.12\right) \cdot x\]
1 - x \cdot \left(0.253 + x \cdot 0.12\right)
\left(1 - 0.253 \cdot x\right) - \left(x \cdot 0.12\right) \cdot x
double f(double x) {
        double r99595 = 1.0;
        double r99596 = x;
        double r99597 = 0.253;
        double r99598 = 0.12;
        double r99599 = r99596 * r99598;
        double r99600 = r99597 + r99599;
        double r99601 = r99596 * r99600;
        double r99602 = r99595 - r99601;
        return r99602;
}

double f(double x) {
        double r99603 = 1.0;
        double r99604 = 0.253;
        double r99605 = x;
        double r99606 = r99604 * r99605;
        double r99607 = r99603 - r99606;
        double r99608 = 0.12;
        double r99609 = r99605 * r99608;
        double r99610 = r99609 * r99605;
        double r99611 = r99607 - r99610;
        return r99611;
}

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 - x \cdot \left(0.253 + x \cdot 0.12\right)\]
  2. Using strategy rm
  3. Applied distribute-rgt-in0.1

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

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

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

Reproduce

herbie shell --seed 2020039 
(FPCore (x)
  :name "Numeric.SpecFunctions:invIncompleteGamma from math-functions-0.1.5.2, A"
  :precision binary64
  (- 1 (* x (+ 0.253 (* x 0.12)))))